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
a76754ff
Commit
a76754ff
authored
Nov 06, 2023
by
lintangsutawika
Browse files
process brier_score
parent
98f9bac9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lm_eval/api/task.py
lm_eval/api/task.py
+7
-1
No files found.
lm_eval/api/task.py
View file @
a76754ff
...
@@ -972,7 +972,10 @@ class ConfigurableTask(Task):
...
@@ -972,7 +972,10 @@ class ConfigurableTask(Task):
def
process_results
(
self
,
doc
,
results
):
def
process_results
(
self
,
doc
,
results
):
if
callable
(
self
.
config
.
process_results
):
if
callable
(
self
.
config
.
process_results
):
return
self
.
config
.
process_results
(
doc
,
results
)
try
:
return
self
.
config
.
process_results
(
self
,
doc
,
results
)
except
:
return
self
.
config
.
process_results
(
doc
,
results
)
result_dict
=
{}
result_dict
=
{}
use_metric
=
list
(
self
.
_metric_fn_list
.
keys
())
use_metric
=
list
(
self
.
_metric_fn_list
.
keys
())
...
@@ -1060,12 +1063,15 @@ class ConfigurableTask(Task):
...
@@ -1060,12 +1063,15 @@ class ConfigurableTask(Task):
# TODO: this gets score of 0 on arc_challenge for pythia-70m. need to test that this works properly
# 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
else
0
exact_match
=
int
(
is_greedy
[
gold
])
if
gold
!=
-
100
else
0
prob_norm
=
[
float
(
i
)
/
sum
(
lls
)
for
i
in
lls
]
result_dict
=
{
result_dict
=
{
**
({
"acc"
:
acc
}
if
"acc"
in
use_metric
else
{}),
**
({
"acc"
:
acc
}
if
"acc"
in
use_metric
else
{}),
**
({
"f1"
:
(
gold
,
pred
)}
if
"f1"
in
use_metric
else
{}),
**
({
"f1"
:
(
gold
,
pred
)}
if
"f1"
in
use_metric
else
{}),
**
({
"mcc"
:
(
gold
,
pred
)}
if
"mcc"
in
use_metric
else
{}),
**
({
"mcc"
:
(
gold
,
pred
)}
if
"mcc"
in
use_metric
else
{}),
**
({
"acc_norm"
:
acc_norm
}
if
"acc_norm"
in
use_metric
else
{}),
**
({
"acc_norm"
:
acc_norm
}
if
"acc_norm"
in
use_metric
else
{}),
**
({
"exact_match"
:
exact_match
}
if
"exact_match"
in
use_metric
else
{}),
**
({
"exact_match"
:
exact_match
}
if
"exact_match"
in
use_metric
else
{}),
**
({
"brier_score"
:
(
gold
,
prob_norm
)}
if
"brier_score"
in
use_metric
else
{}),
}
}
if
"acc_mutual_info"
in
use_metric
:
if
"acc_mutual_info"
in
use_metric
:
...
...
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