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
9e65d0ce
Commit
9e65d0ce
authored
Nov 28, 2023
by
lintangsutawika
Browse files
fixes how num_fewshot from config is read
parent
9f518392
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lm_eval/api/task.py
lm_eval/api/task.py
+1
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+4
-1
No files found.
lm_eval/api/task.py
View file @
9e65d0ce
...
...
@@ -81,7 +81,7 @@ class TaskConfig(dict):
fewshot_delimiter
:
str
=
"
\n\n
"
fewshot_config
:
dict
=
None
# runtime configuration options
num_fewshot
:
int
=
0
num_fewshot
:
int
=
-
1
# scoring options
metric_list
:
list
=
None
output_type
:
str
=
"generate_until"
...
...
lm_eval/evaluator.py
View file @
9e65d0ce
...
...
@@ -138,7 +138,7 @@ def simple_evaluate(
eval_logger
.
info
(
f
"num_fewshot has been set to 0 for
{
task_name
}
in its config. Manual configuration will be ignored."
)
el
if
config
[
"num_fewshot"
]
>
0
:
el
se
:
default_num_fewshot
=
config
[
"num_fewshot"
]
eval_logger
.
warning
(
f
"Overwriting default num_fewshot of
{
task_name
}
from
{
default_num_fewshot
}
to
{
num_fewshot
}
"
...
...
@@ -624,6 +624,9 @@ def evaluate(
else
:
groups_agg
[
group
][
"alias"
]
=
tab_string
+
group
for
group_name
,
task_list
in
task_hierarchy
.
items
():
num_fewshot
[
group_name
]
=
num_fewshot
[
task_list
[
0
]]
results_dict
=
{
"results"
:
dict
(
results_agg
.
items
()),
**
({
"groups"
:
dict
(
groups_agg
.
items
())}
if
bool
(
groups_agg
)
else
{}),
...
...
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