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
10cc0a56
Commit
10cc0a56
authored
Nov 17, 2023
by
lintangsutawika
Browse files
edits and format
parent
cfbad4c4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
5 deletions
+8
-5
lm_eval/__init__.py
lm_eval/__init__.py
+1
-2
lm_eval/__main__.py
lm_eval/__main__.py
+2
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+1
-2
lm_eval/models/anthropic_llms.py
lm_eval/models/anthropic_llms.py
+1
-0
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+1
-0
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+1
-0
lm_eval/utils.py
lm_eval/utils.py
+1
-0
No files found.
lm_eval/__init__.py
View file @
10cc0a56
# from .evaluator import evaluate, simple_evaluate
# from .logger import eval_logger, SPACING
from
.evaluator
import
evaluate
,
simple_evaluate
lm_eval/__main__.py
View file @
10cc0a56
...
...
@@ -13,6 +13,7 @@ from lm_eval import evaluator, utils
from
lm_eval.tasks
import
initialize_tasks
,
include_path
from
lm_eval.api.registry
import
ALL_TASKS
def
_handle_non_serializable
(
o
):
if
isinstance
(
o
,
np
.
int64
)
or
isinstance
(
o
,
np
.
int32
):
return
int
(
o
)
...
...
@@ -163,7 +164,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
missing
=
", "
.
join
(
task_missing
)
eval_logger
.
error
(
f
"Tasks were not found:
{
missing
}
\n
"
f
"
{
' '
*
47
}
Try `lm-eval --tasks list` for list of available tasks"
,
f
"
{
utils
.
SPACING
}
Try `lm-eval --tasks list` for list of available tasks"
,
)
raise
ValueError
(
f
"Tasks
{
missing
}
were not found. Try `lm-eval --tasks list` for list of available tasks."
...
...
lm_eval/evaluator.py
View file @
10cc0a56
...
...
@@ -20,7 +20,7 @@ from lm_eval.utils import (
make_table
,
create_iterator
,
get_git_commit_hash
,
eval_logger
eval_logger
,
)
...
...
@@ -40,7 +40,6 @@ def simple_evaluate(
decontamination_ngrams_path
=
None
,
write_out
:
bool
=
False
,
log_samples
:
bool
=
True
,
verbosity
:
str
=
"INFO"
,
):
"""Instantiate and evaluate a model on a list of tasks.
...
...
lm_eval/models/anthropic_llms.py
View file @
10cc0a56
...
...
@@ -7,6 +7,7 @@ from typing import List, Any, Tuple
eval_logger
=
utils
.
eval_logger
def
anthropic_completion
(
client
,
#: anthropic.Anthropic,
model
:
str
,
...
...
lm_eval/models/huggingface.py
View file @
10cc0a56
...
...
@@ -26,6 +26,7 @@ from typing import List, Optional, Union
eval_logger
=
utils
.
eval_logger
def
_get_accelerate_args
(
device_map_option
:
Optional
[
str
]
=
"auto"
,
max_memory_per_gpu
:
Optional
[
Union
[
int
,
str
]]
=
None
,
...
...
lm_eval/tasks/__init__.py
View file @
10cc0a56
...
...
@@ -14,6 +14,7 @@ from lm_eval.api.registry import (
)
import
logging
eval_logger
=
utils
.
eval_logger
...
...
lm_eval/utils.py
View file @
10cc0a56
...
...
@@ -30,6 +30,7 @@ eval_logger = logging.getLogger("lm-eval")
SPACING
=
" "
*
47
def
escaped_split
(
text
,
sep_char
,
maxsplit
=-
1
):
"""Split text into a list on occurrences of the given separation
character `sep_char`. The separation character may be escaped by a
...
...
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