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
0b62e042
Unverified
Commit
0b62e042
authored
Jul 03, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Jul 03, 2023
Browse files
Update task.py
parent
445beade
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lm_eval/api/task.py
lm_eval/api/task.py
+2
-2
No files found.
lm_eval/api/task.py
View file @
0b62e042
...
...
@@ -834,7 +834,6 @@ class ConfigurableTask(Task):
else
:
gold
=
int
(
self
.
doc_to_target
(
doc
))
pred
=
np
.
argmax
(
lls
)
# retrieve choices in List[str] form, to compute choice lengths, etc.
choices
=
ast
.
literal_eval
(
utils
.
apply_template
(
...
...
@@ -852,6 +851,8 @@ class ConfigurableTask(Task):
# and this stores our "regular" conditional loglikelihoods
lls
=
lls
[::
2
]
pred
=
np
.
argmax
(
lls
)
acc
=
1.0
if
np
.
argmax
(
lls
)
==
gold
else
0.0
completion_len
=
np
.
array
([
float
(
len
(
i
))
for
i
in
choices
])
acc_norm
=
1.0
if
np
.
argmax
(
lls
/
completion_len
)
==
gold
else
0.0
...
...
@@ -863,7 +864,6 @@ class ConfigurableTask(Task):
**
({
"acc_norm"
:
acc_norm
}
if
"acc_norm"
in
use_metric
else
{}),
}
# TODO: set which normalization metrics should be reported, and calculate them
if
"exact_match"
in
self
.
_metric_fn_list
.
keys
():
# TODO: this gets score of 0 on arc_challenge for pythia-70m. need to test that this works properly
is_greedy
=
is_greedy
[
gold
]
# take value for the gold answer
...
...
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