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
7d6b39ed
Commit
7d6b39ed
authored
May 16, 2023
by
lintangsutawika
Browse files
fewshot_doc
parent
8d608117
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
lm_eval/api/task.py
lm_eval/api/task.py
+12
-4
No files found.
lm_eval/api/task.py
View file @
7d6b39ed
...
...
@@ -23,6 +23,7 @@ from lm_eval.api.metrics import (
get_metric
,
get_aggregation
,
mean
,
weighted_perplexity
,
bits_per_byte
)
from
lm_eval.logger
import
eval_logger
from
lm_eval.prompts
import
get_prompt
from
lm_eval.filters
import
build_filter_ensemble
...
...
@@ -226,7 +227,10 @@ class Task(abc.ABC):
elif
self
.
has_validation_docs
():
return
self
.
validation_docs
()
else
:
# TODO: should we allow this case to occur? / should raise a warning here
eval_logger
.
warning
(
"has_training_docs and has_validation_docs are False"
,
"using test_docs but this is not recommended."
)
return
self
.
test_docs
()
def
_process_doc
(
self
,
doc
):
...
...
@@ -522,11 +526,15 @@ class ConfigurableTask(Task):
return
self
.
dataset
[
self
.
_config
.
test_split
]
def
fewshot_docs
(
self
):
if
(
self
.
num_fewshot
>
0
)
and
(
self
.
_config
.
fewshot_split
==
None
):
eval_logger
.
warning
(
"num_fewshot > 0 but fewshot_split is None"
,
"using preconfigured rule."
)
return
super
().
fewshot_docs
()
if
self
.
_config
.
fewshot_split
:
return
self
.
dataset
[
self
.
_config
.
fewshot_split
]
else
:
# TODO: warn user if fewshot split isn't explicitly set
return
super
().
fewshot_docs
()
def
should_decontaminate
(
self
):
return
self
.
_config
.
should_decontaminate
...
...
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