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
003c2581
"vscode:/vscode.git/clone" did not exist on "2bcf98d70610bdff1d6f39f752949f6a0f8c5b89"
Unverified
Commit
003c2581
authored
Jul 09, 2023
by
Lintang Sutawika
Committed by
GitHub
Jul 09, 2023
Browse files
multple_choice handles 2 cases
parent
87d93e99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lm_eval/api/task.py
lm_eval/api/task.py
+10
-4
No files found.
lm_eval/api/task.py
View file @
003c2581
...
@@ -772,19 +772,25 @@ class ConfigurableTask(Task):
...
@@ -772,19 +772,25 @@ class ConfigurableTask(Task):
# TODO: any cleaner way to do this?
# TODO: any cleaner way to do this?
if
self
.
multiple_input
:
if
self
.
multiple_input
:
choices
=
self
.
doc_to_text
(
doc
)
choices
=
self
.
doc_to_text
(
doc
)
continuation
=
self
.
doc_to_target
(
doc
)
cont
=
self
.
doc_to_target
(
doc
)
arguments
=
[
(
ctx
,
" {}"
.
format
(
cont
))
for
ctx
in
choices
]
else
:
else
:
continuation
=
self
.
create_choices
(
doc
)
cont
=
self
.
create_choices
(
doc
)
arguments
=
[
(
ctx
,
" {}"
.
format
(
cont
))
for
cont
in
choices
]
request_list
=
[
request_list
=
[
Instance
(
Instance
(
request_type
=
"loglikelihood"
,
request_type
=
"loglikelihood"
,
doc
=
doc
,
doc
=
doc
,
arguments
=
(
ctx
,
" {}"
.
format
(
choice
))
,
arguments
=
arguments
,
idx
=
i
,
idx
=
i
,
**
kwargs
,
**
kwargs
,
)
)
for
i
,
choice
in
enumerate
(
choice
s
)
for
i
,
arg
in
enumerate
(
argument
s
)
]
]
# TODO: we should raise a warning telling users this will at most ~2x runtime.
# TODO: we should raise a warning telling users this will at most ~2x runtime.
if
"acc_mutual_info"
in
self
.
_metric_fn_list
.
keys
():
if
"acc_mutual_info"
in
self
.
_metric_fn_list
.
keys
():
...
...
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