Skip to content

Commit e469d7e

Browse files
clefourrierNathanHBThom Wolf
committed
Init
Co-authored-by: Nathan Habib <nathan.habib@huggingface.co> Co-authored-by: Thom Wolf <thom@huggingface.co>
0 parents  commit e469d7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+17355
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.json filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# log and data files
2+
*.model
3+
*.pkl
4+
#*.ipynb
5+
output
6+
result
7+
*.pt
8+
tests/data/asr
9+
.DS_Store
10+
bert.pt.json
11+
work
12+
runs
13+
*.parquet
14+
*.json
15+
cache/
16+
fastspeech_output
17+
.hydra
18+
.bash_history.local
19+
20+
# Byte-compiled / optimized / DLL files
21+
__pycache__/
22+
*.py[cod]
23+
*$py.class
24+
**.pyc
25+
26+
# C extensions
27+
*.so
28+
29+
# Distribution / packaging
30+
.idea
31+
.Python
32+
wandb
33+
build/
34+
develop-eggs/
35+
dist/
36+
downloads/
37+
eggs/
38+
.eggs/
39+
lib/
40+
lib64/
41+
#parts/
42+
sdist/
43+
var/
44+
wheels/
45+
pip-wheel-metadata/
46+
share/python-wheels/
47+
*.egg-info/
48+
.installed.cfg
49+
*.egg
50+
MANIFEST
51+
52+
# PyInstaller
53+
# Usually these files are written by a python script from a template
54+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
55+
*.manifest
56+
*.spec
57+
58+
# Installer logs
59+
pip-log.txt
60+
pip-delete-this-directory.txt
61+
62+
# Unit test / coverage reports
63+
htmlcov/
64+
.tox/
65+
.nox/
66+
.coverage
67+
.coverage.*
68+
.cache
69+
nosetests.xml
70+
coverage.xml
71+
*.cover
72+
.hypothesis/
73+
.pytest_cache/
74+
75+
# Translations
76+
*.mo
77+
*.pot
78+
79+
# Django stuff:
80+
*.log
81+
local_settings.py
82+
db.sqlite3
83+
84+
# Flask stuff:
85+
instance/
86+
.webassets-cache
87+
88+
# Scrapy stuff:
89+
.scrapy
90+
91+
# Sphinx documentation
92+
docs/build
93+
94+
# PyBuilder
95+
target/
96+
97+
# Jupyter Notebook
98+
.ipynb_checkpoints
99+
100+
# Override Jupyter in Github Language states for more accurate estimate of repo code.
101+
# Reference: https://github.com/github/linguist/blob/master/docs/overrides.md#generated-code
102+
*.ipynb linguist-generated
103+
104+
# IPython
105+
profile_default/
106+
ipython_config.py
107+
108+
# pyenv
109+
.python-version
110+
111+
# pipenv
112+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
113+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
114+
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
115+
# install all needed dependencies.
116+
#Pipfile.lock
117+
118+
# celery beat schedule file
119+
celerybeat-schedule
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# VSCode project settins
134+
.vscode/
135+
136+
# Spyder project settings
137+
.spyderproject
138+
.spyproject
139+
140+
# Rope project settings
141+
.ropeproject
142+
143+
# mkdocs documentation
144+
/site
145+
/docs/html
146+
/docs/docs_zh/zh
147+
148+
# mypy
149+
.mypy_cache/
150+
.dmypy.json
151+
dmypy.json
152+
153+
# Pyre type checker
154+
.pyre/
155+
156+
# Emacs backup files
157+
*~
158+
159+
cifar-10-batches-py
160+
*.tar.gz
161+
162+
# Test data.
163+
tests/.data
164+
tests/data
165+
166+
# outputs folder
167+
examples/*/outputs
168+
examples/*/NeMo_experiments
169+
examples/*/nemo_experiments
170+
examples/*/.hydra
171+
examples/*/wandb
172+
examples/*/data
173+
wandb
174+
dump.py
175+
176+
docs/sources/source/test_build/
177+
178+
# Checkpoints, config files and temporary files created in tutorials.
179+
examples/neural_graphs/*.chkpt
180+
examples/neural_graphs/*.yml
181+
182+
.hydra/
183+
nemo_experiments/
184+
185+
.ruff_cache
186+
187+
tmp.py
188+
189+
examples
190+
benchmark_output
191+
prod_env
192+
193+
logs
194+
_logs
195+
outputs

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
default_language_version:
16+
python: python3
17+
18+
ci:
19+
autofix_prs: true
20+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
21+
autoupdate_schedule: quarterly
22+
23+
repos:
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v4.3.0
26+
hooks:
27+
- id: check-yaml
28+
- id: check-case-conflict
29+
- id: detect-private-key
30+
- id: check-added-large-files
31+
args: ['--maxkb=1000']
32+
- id: end-of-file-fixer
33+
- id: trailing-whitespace
34+
35+
- repo: https://github.com/charliermarsh/ruff-pre-commit
36+
# Ruff version.
37+
rev: 'v0.1.6'
38+
hooks:
39+
- id: ruff
40+
- id: ruff-format

README.md

Lines changed: 295 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Code style
2+
[tool.ruff]
3+
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
4+
# Never enforce `E501` (line length violations).
5+
ignore = ["E501"]
6+
select = ["C", "E", "F", "I", "W"]
7+
line-length = 119
8+
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
9+
10+
[tool.ruff.isort]
11+
lines-after-imports = 2
12+
known-first-party = ["lighteval"]
13+
14+
[tool.ruff.format]
15+
quote-style = "double" # Like Black, use double quotes for strings.
16+
indent-style = "space" # Like Black, indent with spaces, rather than tabs.
17+
skip-magic-trailing-comma = false # Like Black, respect magic trailing commas.
18+
line-ending = "auto" # Like Black, automatically detect the appropriate line ending.
19+
20+
# Building package
21+
[build-system]
22+
requires = ["setuptools>=61.0"]
23+
build-backend = "setuptools.build_meta"
24+
25+
[tool.setuptools.packages.find]
26+
where = ["src"]
27+
28+
[project]
29+
name = "lighteval"
30+
version = "0.0.1"
31+
authors = [
32+
{ name="Clémentine Fourrier", email="clementine@huggingface.com" },
33+
{ name="Nathan Habib", email="nathan.habib@huggingface.com" },
34+
{ name="Thomas Wolf", email="thom@huggingface.com" },
35+
]
36+
maintainers = [
37+
{ name="Clémentine Fourrier", email="clementine@huggingface.com" },
38+
{ name="Nathan Habib", email="nathan.habib@huggingface.com" },
39+
]
40+
description = "A lightweight and configurable evaluation package"
41+
readme = "README.md"
42+
requires-python = ">=3.10"
43+
license = {text = "MIT License"}
44+
classifiers = [
45+
"Programming Language :: Python :: 3",
46+
"License :: OSI Approved :: MIT License",
47+
"Operating System :: OS Independent",
48+
]
49+
keywords = ["evaluation", "nlp", "llm"]
50+
dependencies = [
51+
# Base dependencies
52+
"transformers>=4.36.0",
53+
"huggingface_hub==0.19.4",
54+
"torch>=2.0",
55+
"GitPython==3.1.31", # for logging
56+
"datasets>=2.14.0",
57+
# Test
58+
"pytest==7.4.0",
59+
# Prettiness
60+
"termcolor==2.3.0",
61+
"pytablewriter",
62+
"colorama",
63+
# Base metrics
64+
"nltk==3.8.1",
65+
"numpy",
66+
"scikit-learn",
67+
"spacy==3.7.2",
68+
"sacrebleu",
69+
"rouge_score==0.1.2",
70+
"sentencepiece==0.1.99",
71+
"protobuf==3.20.*", # pinned for sentencepiece compat
72+
"pycountry",
73+
# Code style
74+
"ruff==v0.1.2",
75+
]
76+
77+
[project.optional-dependencies]
78+
accelerate = ["accelerate@git+https://github.com/huggingface/accelerate@739b135f8367becb67ffaada12fe76e3aa60fefd"]
79+
tgi = ["text-generation==0.6.0"]
80+
optimum = ["optimum==1.12.0"]
81+
# Quantization and adapter weights
82+
quantization = ["bitsandbytes>=0.41.0", "auto-gptq>=0.4.2"]
83+
adapters = ["peft==0.3.0"]
84+
nanotron = [
85+
"nanotron@git+https://github.com/huggingface/nanotron@8c1a49588d0745a6404644a86547c2dd6a63640e",
86+
"brrr@git+https://github.com/huggingface/brrr@e8a503e2ec08b34eed7522d331aec3bee8cdd29b",
87+
"tensorboardX"
88+
]
89+
90+
91+
[project.urls]
92+
Homepage = "https://github.com/huggingface/lighteval"
93+
Issues = "https://github.com/huggingface/lighteval/issues"
94+
# Documentation = ""
95+
# Changelog = "https://github.com/huggingface/lighteval/blob/master/CHANGELOG.md"

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from setuptools import setup
2+
3+
4+
setup()

src/lighteval/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)