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
3fe4b022
Commit
3fe4b022
authored
Oct 08, 2025
by
Baber
Browse files
fixup fewshots
parent
42478664
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
lm_eval/api/task.py
lm_eval/api/task.py
+1
-2
lm_eval/config/task.py
lm_eval/config/task.py
+4
-4
No files found.
lm_eval/api/task.py
View file @
3fe4b022
...
...
@@ -675,9 +675,8 @@ class ConfigurableTask(Task):
self
.
config
.
fewshot_cfg
.
num_fewshot
()
>
0
and
self
.
fewshot_docs
()
is
not
None
):
self
.
fewshot_rnd
=
random
.
Random
()
self
.
sampler
=
self
.
config
.
fewshot_cfg
.
init_sampler
(
list
(
self
.
fewshot_docs
()),
rnd
=
self
.
fewshot_rnd
list
(
self
.
fewshot_docs
()),
self
,
rnd
=
self
.
fewshot_rnd
)
self
.
task_docs
=
self
.
eval_docs
...
...
lm_eval/config/task.py
View file @
3fe4b022
...
...
@@ -114,15 +114,14 @@ class FewshotConfig:
if
rnd
is
None
:
raise
ValueError
(
"A `random.Random` generator argument must be provided to `rnd` of FewShotSampler!"
)
)
from
None
return
self
.
get_sampler
(
docs
,
task
,
rnd
=
rnd
,
fewshot_indices
=
fewshot_indices
if
fewshot_indices
else
self
.
fewshot_indices
,
)
)
# type: ignore
@
dataclass
...
...
@@ -170,7 +169,8 @@ class TaskConfig:
should_decontaminate
:
bool
=
False
doc_to_decontamination_query
:
str
|
None
=
None
gen_prefix
:
str
|
None
=
None
multiple_input
:
bool
=
False
multiple_inputs
:
bool
=
False
multiple_targets
:
bool
=
False
metadata
:
dict
=
field
(
default_factory
=
dict
)
# by default, not used in the code. allows for users to pass arbitrary info to 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