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
dc544beb
Unverified
Commit
dc544beb
authored
Aug 30, 2023
by
Lintang Sutawika
Committed by
GitHub
Aug 30, 2023
Browse files
Merge pull request #813 from EleutherAI/asdiv
[Refactor] Asdiv
parents
084a9119
25a667f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
lm_eval/api/task.py
lm_eval/api/task.py
+8
-2
lm_eval/tasks/README.md
lm_eval/tasks/README.md
+1
-1
lm_eval/tasks/asdiv/default.yaml
lm_eval/tasks/asdiv/default.yaml
+12
-0
No files found.
lm_eval/api/task.py
View file @
dc544beb
...
...
@@ -90,6 +90,12 @@ class TaskConfig(dict):
def
__post_init__
(
self
):
if
"."
in
self
.
dataset_path
:
import
inspect
from
importlib
import
import_module
self
.
dataset_path
=
inspect
.
getfile
(
import_module
(
self
.
dataset_path
))
if
self
.
generation_kwargs
is
not
None
:
if
self
.
output_type
!=
"greedy_until"
:
eval_logger
.
warning
(
...
...
@@ -792,7 +798,7 @@ class ConfigurableTask(Task):
return
doc
[
doc_to_text
]
else
:
text_string
=
utils
.
apply_template
(
doc_to_text
,
doc
)
if
text_string
.
isdigit
():
if
text_string
.
isdigit
()
and
self
.
_config
.
doc_to_choice
is
not
None
:
return
ast
.
literal_eval
(
text_string
)
else
:
return
text_string
...
...
@@ -827,7 +833,7 @@ class ConfigurableTask(Task):
return
doc
[
doc_to_target
]
else
:
target_string
=
utils
.
apply_template
(
doc_to_target
,
doc
)
if
target_string
.
isdigit
():
if
target_string
.
isdigit
()
and
self
.
_config
.
doc_to_choice
is
not
None
:
return
ast
.
literal_eval
(
target_string
)
elif
(
len
(
target_string
)
>=
2
...
...
lm_eval/tasks/README.md
View file @
dc544beb
...
...
@@ -38,7 +38,7 @@ Boxes should be checked iff tasks are implemented in the refactor and tested for
-
[x] TruthfulQA (gen)
-
[ ] MuTual
-
[ ] Hendrycks Math (Hailey)
-
[
] Asdiv
-
[
x
] Asdiv
-
[ ] GSM8k
-
[x] Arithmetic
-
[ ] MMMLU (Hailey)
...
...
lm_eval/tasks/asdiv/default.yaml
0 → 100644
View file @
dc544beb
task
:
asdiv
dataset_path
:
EleutherAI/asdiv
output_type
:
loglikelihood
validation_split
:
validation
doc_to_text
:
"
{{body}}
\n
Question:{{question}}
\n
Answer:"
doc_to_target
:
"
{{answer.split('
(')[0]}}"
should_decontaminate
:
true
doc_to_decontamination_query
:
"
{{body}}
{{question}}"
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
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