Skip to content

Commit

Permalink
Only support newest versions of lm-eval (pytorch#556)
Browse files Browse the repository at this point in the history
Summary:
remove support for lm-eval 0.3 to reduce the options we have

Test Plan:
CI

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
jerryzh168 authored and malfet committed Jul 17, 2024
1 parent ead68a4 commit 05bd844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
22 changes: 4 additions & 18 deletions eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,11 @@
torch._inductor.config.triton.cudagraphs = True
torch._dynamo.config.cache_size_limit = 100000

try:
import lm_eval
import lm_eval

lm_eval_available = True
except:
lm_eval_available = False


if lm_eval_available:
try: # lm_eval version 0.4
from lm_eval.evaluator import evaluate
from lm_eval.models.huggingface import HFLM as eval_wrapper
from lm_eval.tasks import get_task_dict
except: # lm_eval version 0.3
from lm_eval import base, evaluator, tasks

eval_wrapper = base.BaseLM
get_task_dict = tasks.get_task_dict
evaluate = evaluator.evaluate
from lm_eval.evaluator import evaluate
from lm_eval.models.huggingface import HFLM as eval_wrapper
from lm_eval.tasks import get_task_dict


def setup_cache_padded_seq_input_pos_max_seq_length_for_prefill(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ snakeviz
sentencepiece
numpy
gguf
lm-eval
lm-eval==0.4
blobfile

# Build tools
Expand Down

0 comments on commit 05bd844

Please sign in to comment.