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
ff148cd8
Commit
ff148cd8
authored
Oct 19, 2023
by
haileyschoelkopf
Browse files
don't call evaluate.load() every time
parent
8d4d1fa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lm_eval/api/metrics.py
lm_eval/api/metrics.py
+5
-2
No files found.
lm_eval/api/metrics.py
View file @
ff148cd8
...
...
@@ -136,14 +136,17 @@ def acc_mutual_info_fn(items): # This is a passthrough function
return
items
exact_match
=
evaluate
.
load
(
"exact_match"
)
@
register_metric
(
metric
=
"exact_match"
,
higher_is_better
=
True
,
output_type
=
"generate_until"
,
aggregation
=
"mean"
,
)
def
exact_match_fn
(
**
kwargs
):
# This is a passthrough function
return
evaluate
.
load
(
"
exact_match
"
)
.
compute
(
**
kwargs
)
def
exact_match_fn
(
**
kwargs
):
return
exact_match
.
compute
(
**
kwargs
)
@
register_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