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
8d1d003d
Unverified
Commit
8d1d003d
authored
Aug 30, 2023
by
Lintang Sutawika
Committed by
GitHub
Aug 30, 2023
Browse files
Update task.py
parent
cddbf9f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lm_eval/api/task.py
lm_eval/api/task.py
+7
-7
No files found.
lm_eval/api/task.py
View file @
8d1d003d
...
...
@@ -1017,16 +1017,16 @@ class ConfigurableTask(Task):
gold_index_error
=
False
if
type
(
gold
)
is
list
:
gold
=
[
i
if
i
<
len
(
choices
)
else
-
100
0
for
i
in
gold
]
if
-
100
0
in
gold
:
gold
=
[
i
if
i
<
len
(
choices
)
else
-
100
for
i
in
gold
]
if
-
100
in
gold
:
gold_index_error
=
True
else
:
if
type
(
gold
)
is
int
:
gold
=
gold
if
gold
<
len
(
choices
)
else
-
100
0
gold
=
gold
if
gold
<
len
(
choices
)
else
-
100
elif
type
(
gold
)
is
str
:
gold
=
choices
.
index
(
gold
)
if
gold
in
choices
else
-
100
0
gold
=
choices
.
index
(
gold
)
if
gold
in
choices
else
-
100
if
gold
==
-
100
0
:
if
gold
==
-
100
:
gold_index_error
=
True
if
gold_index_error
:
...
...
@@ -1039,13 +1039,13 @@ class ConfigurableTask(Task):
acc
=
1.0
if
pred
in
gold
else
0.0
acc_norm
=
1.0
if
pred_norm
in
gold
else
0.0
exact_match
=
int
(
any
([
is_greedy
[
i
]
if
i
!=
-
100
0
else
0
for
i
in
gold
])
any
([
is_greedy
[
i
]
if
i
!=
-
100
else
0
for
i
in
gold
])
)
else
:
acc
=
1.0
if
pred
==
gold
else
0.0
acc_norm
=
1.0
if
pred_norm
==
gold
else
0.0
# TODO: this gets score of 0 on arc_challenge for pythia-70m. need to test that this works properly
exact_match
=
int
(
is_greedy
[
gold
])
if
gold
!=
-
100
0
else
0
exact_match
=
int
(
is_greedy
[
gold
])
if
gold
!=
-
100
else
0
result_dict
=
{
**
({
"acc"
:
acc
}
if
"acc"
in
use_metric
else
{}),
...
...
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