Skip to content

Better error message for lm_eval script #444

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

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
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
23 changes: 20 additions & 3 deletions scripts/hf_eval.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import torch

from transformers import AutoModelForCausalLM, AutoTokenizer
try:
from lm_eval.models.huggingface import HFLM
from lm_eval.evaluator import evaluate
from lm_eval.tasks import get_task_dict
except ImportError as e:
print("""
Error: The 'lm_eval' module was not found.
To install, follow these steps:

from lm_eval.models.huggingface import HFLM
from lm_eval.evaluator import evaluate
from lm_eval.tasks import get_task_dict
1. Clone the repository:
git clone https://github.com/EleutherAI/lm-evaluation-harness

2. Change to the cloned directory:
cd lm-evaluation-harness

3. Install the package in editable mode:
pip install -e .

After installation, re-run this script to use the LM Evaluation Harness.
""")
raise # Re-raise the ImportError

from torchao.quantization.quant_api import (
change_linear_weights_to_int4_woqtensors,
Expand Down
Loading