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
cbb04a20
Commit
cbb04a20
authored
Jun 20, 2023
by
haileyschoelkopf
Browse files
remove old code
parent
df18b5a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
35 deletions
+5
-35
lm_eval/api/task.py
lm_eval/api/task.py
+1
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+4
-12
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+0
-22
No files found.
lm_eval/api/task.py
View file @
cbb04a20
...
...
@@ -336,7 +336,7 @@ class Task(abc.ABC):
fewshot_ctx
=
self
.
fewshot_context
(
doc
,
self
.
_config
.
num_fewshot
,
rnd
=
random
.
Random
()
)
# TODO:
hardcoded for now: # of runs on each input to be 2. # TODO: we should override thi
s if doing greedy gen so users don't waste time+compute
# TODO:
we should override self._config.repeat
s if doing greedy gen so users don't waste time+compute
inst
=
self
.
construct_requests
(
doc
=
doc
,
ctx
=
fewshot_ctx
,
...
...
lm_eval/evaluator.py
View file @
cbb04a20
...
...
@@ -183,15 +183,8 @@ def evaluate(
# get lists of each type of request
for
task_name
,
task
in
task_dict
.
items
():
versions
[
task_name
]
=
task
.
VERSION
configs
[
task_name
]
=
dict
(
task
.
dump_config
()
)
# TODO: don't access a private attribute here ; for non-YAML tasks handle this case
# deterministically shuffle docs and chop off the first `limit` because sometimes docs are in some kind of order
# task_docs = list(task_doc_func())
# rnd = random.Random()
# rnd.seed(42)
# rnd.shuffle(task_docs)
configs
[
task_name
]
=
dict
(
task
.
dump_config
())
if
limit
is
not
None
:
if
task
.
has_test_docs
():
task_docs
=
task
.
test_docs
()
...
...
@@ -249,13 +242,12 @@ def evaluate(
task
.
apply_filters
()
### Collect values of metrics on all datapoints ###
# TODO: make metric configurable, add metric registry
vals
=
collections
.
defaultdict
(
list
)
# unpack results and sort back in order and return control to Task
for
task_name
,
task
in
task_dict
.
items
():
#
calculate values for each filter setup (TODO: make getting list of keys clean
er
)
#
TODO: make it possible to use a different metric per key
#
TODO: make it possible to use a different metric per filt
er
#
iterate over different filters used
for
key
in
task
.
instances
[
0
].
filtered_resps
.
keys
():
doc_iterator
=
(
itertools
.
islice
(
...
...
lm_eval/tasks/__init__.py
View file @
cbb04a20
...
...
@@ -124,28 +124,6 @@ def get_task_dict(task_name_list: List[Union[str, dict, Task]], **kwargs):
get_task_name_from_object
(
task_element
):
task_element
,
}
# task_name_from_registry_dict = {
# task_name: get_task(
# task_name=task_name,
# task_config=config
# )
# for group_name in task_name_list for task_name in GROUP_REGISTRY[group_name]
# if (isinstance(group_name, str)) and (group_name in GROUP_REGISTRY)
# }
# task_name_from_config_dict = {
# get_task_name_from_config(task_config): ConfigurableTask(
# config=task_config
# )
# for task_config in task_name_list
# if isinstance(task_config, dict)
# }
# # TODO: Do we still need this?
# task_name_from_object_dict = {
# get_task_name_from_object(task_object): task_object
# for task_object in task_name_list
# if isinstance(task_object, Task)
# }
assert
set
(
task_name_from_registry_dict
.
keys
()).
isdisjoint
(
set
(
task_name_from_object_dict
.
keys
())
)
...
...
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