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
633fb458
Unverified
Commit
633fb458
authored
Jul 05, 2023
by
Lintang Sutawika
Committed by
GitHub
Jul 05, 2023
Browse files
Update task.py
parent
4f0a7e57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
lm_eval/api/task.py
lm_eval/api/task.py
+21
-7
No files found.
lm_eval/api/task.py
View file @
633fb458
...
...
@@ -99,13 +99,27 @@ class TaskConfig(dict):
if
type
(
self
.
gold_alias
)
==
str
:
self
.
gold_alias
=
self
.
template_aliases
+
self
.
gold_alias
if
self
.
generation_kwargs
:
assert
(
self
.
output_type
==
"greedy_until"
),
"passed `generation_kwargs`, but not using a generation request type!"
elif
self
.
output_type
==
"greedy_until"
:
# ensure that we greedily generate in absence of explicit arguments otherwise
self
.
generation_kwargs
=
{
"do_sample"
:
False
,
"temperature"
:
0.0
}
if
self
.
generation_kwargs
is
not
None
:
if
self
.
output_type
!=
"greedy_until"
:
eval_logger
.
warning
(
"passed `generation_kwargs`, but not using a generation request type!"
)
if
"temperature"
in
self
.
generation_kwargs
:
self
.
generation_kwargs
[
"temperature"
]
=
float
(
self
.
generation_kwargs
[
"temperature"
]
)
if
"until"
not
in
self
.
generation_kwargs
:
self
.
generation_kwargs
[
"until"
]
=
[
self
.
target_delimiter
]
else
:
if
self
.
output_type
==
"greedy_until"
:
# ensure that we greedily generate in absence of explicit arguments otherwise
self
.
generation_kwargs
=
{
"until"
:
None
if
self
.
target_delimiter
is
None
else
[
self
.
target_delimiter
],
"do_sample"
:
False
,
"temperature"
:
0.0
,
}
# TODO: how to make TaskConfigs be de- and re-serializable, even when using the !function constructor?
...
...
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