Skip to content

Commit 705bedd

Browse files
authored
unpin datasets; update pre-commit (#3316)
* update pre-commit * unpin datasets
1 parent a1404f0 commit 705bedd

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,37 @@
22
exclude: ^tests/testdata/
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v5.0.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-added-large-files
88
- id: check-ast
9-
- id: check-byte-order-marker
9+
- id: fix-byte-order-marker
1010
- id: check-case-conflict
1111
- id: check-json
1212
- id: check-merge-conflict
13-
args: [--assume-in-merge]
13+
args: [ --assume-in-merge ]
1414
- id: check-symlinks
1515
- id: check-yaml
16-
args: ["--unsafe"]
16+
args: [ "--unsafe" ]
1717
- id: destroyed-symlinks
1818
- id: detect-private-key
1919
- id: end-of-file-fixer
2020
- id: no-commit-to-branch
2121
always_run: false
2222
- id: requirements-txt-fixer
2323
- id: trailing-whitespace
24-
args: [--markdown-linebreak-ext=md]
24+
args: [ --markdown-linebreak-ext=md ]
2525
- id: fix-byte-order-marker
2626
exclude: docs/CNAME
27-
- id: fix-encoding-pragma
28-
args: [--remove]
2927
- id: mixed-line-ending
30-
args: [--fix=lf]
28+
args: [ --fix=lf ]
3129
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: v0.12.2
30+
rev: v0.13.2
3331
hooks:
3432
# Run the linter.
35-
- id: ruff
36-
args:
37-
- --fix
38-
# Run the formatter.
33+
- id: ruff-check
34+
args: [ --fix ]
35+
# Run the formatter.
3936
- id: ruff-format
4037
- repo: https://github.com/codespell-project/codespell
4138
rev: v2.4.1
@@ -47,10 +44,10 @@ repos:
4744
.*\.json|ignore.txt|lm_eval/tasks/.*|.*yaml|.*\.ipynb
4845
)$
4946
50-
args: [--check-filenames, --check-hidden, --ignore-words=ignore.txt]
47+
args: [ --check-filenames, --check-hidden, --ignore-words=ignore.txt ]
5148
- repo: https://github.com/jackdewinter/pymarkdown
52-
rev: v0.9.30
49+
rev: v0.9.32
5350
hooks:
5451
- id: pymarkdown
5552
exclude: ^(lm_eval/tasks/.*|docs/footguns\.md)$
56-
args: [fix, -r]
53+
args: [ fix, -r ]

lm_eval/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
437437

438438
if vparse(datasets.__version__) < vparse("4.0.0"):
439439
datasets.config.HF_DATASETS_TRUST_REMOTE_CODE = True
440+
else:
441+
eval_logger.warning(
442+
"trust_remote_code and datasets scripts are no longer supported on datasets>=4.0.0. Skipping. If your task still requires this, please downgrade to datasets==3.6.0 or earlier."
443+
)
440444

441445
if isinstance(args.model_args, dict):
442446
args.model_args["trust_remote_code"] = True

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "lm_eval"
77
version = "0.4.9.1"
88
authors = [
9-
{name="EleutherAI", email="[email protected]"}
9+
{ name = "EleutherAI", email = "[email protected]" }
1010
]
1111
description = "A framework for evaluating language models"
1212
readme = "README.md"
@@ -21,7 +21,7 @@ license = { "text" = "MIT" }
2121
dependencies = [
2222
"accelerate>=0.26.0",
2323
"evaluate",
24-
"datasets>=2.16.0,<4.0",
24+
"datasets>=2.16.0",
2525
"evaluate>=0.4.0",
2626
"jsonlines",
2727
"numexpr",
@@ -68,8 +68,8 @@ ibm_watsonx_ai = ["ibm_watsonx_ai>=1.1.22", "python-dotenv"]
6868
ifeval = ["langdetect", "immutabledict", "nltk>=3.9.1"]
6969
ipex = ["optimum"]
7070
japanese_leaderboard = ["emoji==2.14.0", "neologdn==0.5.3", "fugashi[unidic-lite]", "rouge_score>=0.1.2"]
71-
longbench=["jieba", "fuzzywuzzy", "rouge"]
72-
libra=["pymorphy2"]
71+
longbench = ["jieba", "fuzzywuzzy", "rouge"]
72+
libra = ["pymorphy2"]
7373
mamba = ["mamba_ssm", "causal-conv1d==1.0.2", "torch"]
7474
math = ["sympy>=1.12", "antlr4-python3-runtime==4.11", "math_verify[antlr4_11_0]"]
7575
multilingual = ["nagisa>=0.2.7", "jieba>=0.42.1", "pycountry"]
@@ -115,10 +115,10 @@ lines-after-imports = 2
115115
known-first-party = ["lm_eval"]
116116

117117
[tool.ruff.lint.extend-per-file-ignores]
118-
"__init__.py" = ["F401","F402","F403"]
118+
"__init__.py" = ["F401", "F402", "F403"]
119119
"utils.py" = ["F401"]
120120

121121
[dependency-groups]
122122
dev = [
123-
"api","dev","sentencepiece"
123+
"api", "dev", "sentencepiece"
124124
]

0 commit comments

Comments
 (0)