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
42d5c4bf
Unverified
Commit
42d5c4bf
authored
Jun 03, 2024
by
LSinev
Committed by
GitHub
Jun 03, 2024
Browse files
Fix fewshot seed only set when overriding num_fewshot (#1914)
Fix #1906
parent
1060b68d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lm_eval/evaluator.py
lm_eval/evaluator.py
+5
-4
No files found.
lm_eval/evaluator.py
View file @
42d5c4bf
...
@@ -241,14 +241,15 @@ def simple_evaluate(
...
@@ -241,14 +241,15 @@ def simple_evaluate(
f
"Overwriting default num_fewshot of
{
task_name
}
from
{
default_num_fewshot
}
to
{
num_fewshot
}
"
f
"Overwriting default num_fewshot of
{
task_name
}
from
{
default_num_fewshot
}
to
{
num_fewshot
}
"
)
)
task_obj
.
set_config
(
key
=
"num_fewshot"
,
value
=
num_fewshot
)
task_obj
.
set_config
(
key
=
"num_fewshot"
,
value
=
num_fewshot
)
task_obj
.
set_fewshot_seed
(
seed
=
fewshot_random_seed
)
eval_logger
.
info
(
f
"Setting fewshot random generator seed to
{
fewshot_random_seed
}
"
)
else
:
else
:
# if num_fewshot not provided, and the task does not define a default one, default to 0
# if num_fewshot not provided, and the task does not define a default one, default to 0
if
(
default_num_fewshot
:
=
task_obj
.
get_config
(
"num_fewshot"
))
is
None
:
if
(
default_num_fewshot
:
=
task_obj
.
get_config
(
"num_fewshot"
))
is
None
:
task_obj
.
set_config
(
key
=
"num_fewshot"
,
value
=
0
)
task_obj
.
set_config
(
key
=
"num_fewshot"
,
value
=
0
)
# fewshot_random_seed set for tasks, even with a default num_fewshot (e.g. in the YAML file)
task_obj
.
set_fewshot_seed
(
seed
=
fewshot_random_seed
)
eval_logger
.
info
(
f
"Setting fewshot random generator seed to
{
fewshot_random_seed
}
"
)
if
check_integrity
:
if
check_integrity
:
run_task_tests
(
task_list
=
tasks
)
run_task_tests
(
task_list
=
tasks
)
...
...
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