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
787b23f6
Commit
787b23f6
authored
Jan 02, 2024
by
lintangsutawika
Browse files
readd aggregation
parent
aaf64aab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lm_eval/evaluator.py
lm_eval/evaluator.py
+3
-4
No files found.
lm_eval/evaluator.py
View file @
787b23f6
...
@@ -449,16 +449,15 @@ def evaluate(
...
@@ -449,16 +449,15 @@ def evaluate(
else
:
else
:
group_name
=
None
group_name
=
None
metric
_fn
=
task
.
compute_metric
()[
metric
]
agg
_fn
=
task
.
aggregation
()[
metric
]
results
[
task_name
][
metric_key
]
=
metric
_fn
(
items
)
results
[
task_name
][
metric_key
]
=
agg
_fn
(
items
)
results
[
task_name
][
"samples"
]
=
len
(
items
)
results
[
task_name
][
"samples"
]
=
len
(
items
)
# hotfix: bleu, chrf, ter seem to be really expensive to bootstrap
# hotfix: bleu, chrf, ter seem to be really expensive to bootstrap
# so we run them less iterations. still looking for a cleaner way to do this
# so we run them less iterations. still looking for a cleaner way to do this
if
bootstrap_iters
>
0
:
if
bootstrap_iters
>
0
:
stderr
=
lm_eval
.
api
.
metrics
.
stderr_for_metric
(
stderr
=
lm_eval
.
api
.
metrics
.
stderr_for_metric
(
# metric=task.aggregation()[metric],
metric
=
task
.
aggregation
()[
metric
],
metric
=
task
.
compute_metric
()[
metric
],
bootstrap_iters
=
min
(
bootstrap_iters
,
100
)
bootstrap_iters
=
min
(
bootstrap_iters
,
100
)
if
metric
in
[
"bleu"
,
"chrf"
,
"ter"
]
if
metric
in
[
"bleu"
,
"chrf"
,
"ter"
]
else
bootstrap_iters
,
else
bootstrap_iters
,
...
...
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