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
1794975e
Commit
1794975e
authored
Jul 01, 2024
by
lintangsutawika
Browse files
edit arguments
parent
8a8c2982
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/api/task.py
lm_eval/api/task.py
+3
-3
No files found.
lm_eval/api/task.py
View file @
1794975e
...
...
@@ -1297,6 +1297,8 @@ class ConfigurableTask(Task):
def
construct_requests
(
self
,
doc
:
dict
,
ctx
:
str
,
**
kwargs
)
->
Union
[
List
[
Instance
],
Instance
]:
aux_arguments
=
None
if
self
.
OUTPUT_TYPE
==
"loglikelihood"
:
arguments
=
(
ctx
,
self
.
doc_to_target
(
doc
))
elif
self
.
OUTPUT_TYPE
==
"loglikelihood_rolling"
:
...
...
@@ -1323,8 +1325,6 @@ class ConfigurableTask(Task):
# log(P(choice|ctx) / P(choice)) = log(P(choice|ctx)) - log(P(choice))
# in other words normalizing by subtracting the unconditional logprob of each choice.
aux_arguments
=
[(
""
,
f
"
{
choice
}
"
)
for
choice
in
choices
]
else
:
aux_arguments
=
None
elif
self
.
OUTPUT_TYPE
==
"generate_until"
:
arguments
=
(
ctx
,
deepcopy
(
self
.
config
.
generation_kwargs
))
...
...
@@ -1337,7 +1337,7 @@ class ConfigurableTask(Task):
if
isinstance
(
arguments
,
type
):
if
aux_arguments
is
not
None
:
all_arg_list
=
[
arguments
,
a
rg_list
]
all_arg_list
=
[
arguments
,
a
ux_arguments
]
else
:
all_arg_list
=
[
arguments
]
for
arg_list
in
all_arg_list
:
...
...
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