Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
a6034d0c
Commit
a6034d0c
authored
Jul 08, 2024
by
haileyschoelkopf
Browse files
make scipy an extra
parent
517aadc4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
2 deletions
+22
-2
README.md
README.md
+1
-0
lm_eval/tasks/drop/utils.py
lm_eval/tasks/drop/utils.py
+9
-1
lm_eval/tasks/minerva_math/utils.py
lm_eval/tasks/minerva_math/utils.py
+1
-1
pyproject.toml
pyproject.toml
+2
-0
scripts/model_comparator.py
scripts/model_comparator.py
+9
-0
No files found.
README.md
View file @
a6034d0c
...
...
@@ -451,6 +451,7 @@ Extras dependencies can be installed via `pip install -e ".[NAME]"`
| openai | For using OpenAI's models |
| optimum | For running Intel OpenVINO models |
| promptsource | For using PromptSource prompts |
| scipy | Used in DROP postprocessing and in scripts/model_comparator.py |
| sentencepiece | For using the sentencepiece tokenizer |
| sparseml | For using NM's SparseML models |
| testing | For running library test suite |
...
...
lm_eval/tasks/drop/utils.py
View file @
a6034d0c
...
...
@@ -2,7 +2,15 @@ import re
import
string
import
numpy
as
np
from
scipy.optimize
import
linear_sum_assignment
try
:
from
scipy.optimize
import
linear_sum_assignment
except
ModuleNotFoundError
:
raise
ModuleNotFoundError
(
"`scipy` is required for DROP post-processing.
\
please install scipy via pip install lm-eval[scipy] or pip install -e .[scipy]"
,
)
_ARTICLES
=
re
.
compile
(
r
"\b(a|an|the)\b"
,
re
.
UNICODE
)
...
...
lm_eval/tasks/minerva_math/utils.py
View file @
a6034d0c
...
...
@@ -12,7 +12,7 @@ try:
from
sympy.parsing.latex
import
parse_latex
except
ModuleNotFoundError
:
raise
ModuleNotFoundError
(
"`sympy` is required for
generating translation task prompt templates
.
\
"`sympy` is required for
checking equivalence of minerva_math tasks' answers thoroughly
.
\
please install sympy via pip install lm-eval[math] or pip install -e .[math]"
,
)
...
...
pyproject.toml
View file @
a6034d0c
...
...
@@ -70,6 +70,7 @@ multilingual = ["nagisa>=0.2.7", "jieba>=0.42.1", "pycountry"]
openai
=
[
"openai==1.3.9"
,
"tiktoken"
]
optimum
=
["optimum[openvino]"]
promptsource
=
["promptsource>=0.2.3"]
scipy
=
["scipy"]
sentencepiece
=
["sentencepiece>=0.1.98"]
sparseml
=
["sparseml-nightly[llm]>=1.8.0.20240404"]
testing
=
[
"pytest"
,
"pytest-cov"
,
"pytest-xdist"
]
...
...
@@ -89,6 +90,7 @@ all = [
"lm_eval[multilingual]"
,
"lm_eval[openai]"
,
"lm_eval[promptsource]"
,
"lm_eval[scipy]"
,
"lm_eval[sentencepiece]"
,
"lm_eval[sparseml]"
,
"lm_eval[testing]"
,
...
...
scripts/model_comparator.py
View file @
a6034d0c
...
...
@@ -12,6 +12,15 @@ import lm_eval.models.utils
from
lm_eval
import
tasks
,
utils
try
:
import
scipy.stats
except
ModuleNotFoundError
:
raise
ModuleNotFoundError
(
"`scipy` is required for computing z-scores in hf-vllm comparisons via this script.
\
please install scipy via pip install lm-eval[scipy] or pip install -e .[scipy]"
,
)
os
.
environ
[
"TOKENIZERS_PARALLELISM"
]
=
"false"
eval_logger
=
utils
.
eval_logger
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment