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
9d0df41b
Commit
9d0df41b
authored
Sep 15, 2023
by
haileyschoelkopf
Browse files
add fewshot_config field
parent
624fb207
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lm_eval/api/task.py
lm_eval/api/task.py
+4
-3
No files found.
lm_eval/api/task.py
View file @
9d0df41b
...
...
@@ -75,6 +75,7 @@ class TaskConfig(dict):
description
:
str
=
""
target_delimiter
:
str
=
" "
fewshot_delimiter
:
str
=
"
\n\n
"
fewshot_config
:
dict
=
None
# runtime configuration options
num_fewshot
:
int
=
0
# scoring options
...
...
@@ -629,9 +630,9 @@ class ConfigurableTask(Task):
self
.
prompt
=
None
if
self
.
fewshot_docs
()
is
not
None
:
self
.
sampler
=
samplers
.
S
ampler
(
list
(
self
.
fewshot_docs
()),
self
,
rnd
=
random
.
Random
(
1234
)
)
self
.
sampler
=
samplers
.
get_s
ampler
(
self
.
config
.
fewshot_config
.
get
(
"sampler"
,
"default"
)
)
(
list
(
self
.
fewshot_docs
()),
self
,
rnd
=
random
.
Random
(
1234
))
if
self
.
has_test_docs
():
self
.
task_docs
=
self
.
test_docs
()
...
...
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