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
fc09c8f7
Commit
fc09c8f7
authored
May 11, 2023
by
lintangsutawika
Browse files
minor fix
parent
7bf74f16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
lm_eval/api/task.py
lm_eval/api/task.py
+1
-3
No files found.
lm_eval/api/task.py
View file @
fc09c8f7
...
@@ -136,7 +136,7 @@ class Task(abc.ABC):
...
@@ -136,7 +136,7 @@ class Task(abc.ABC):
self
.
_filters
.
append
(
filter_pipeline
)
self
.
_filters
.
append
(
filter_pipeline
)
self
.
sampler
=
samplers
.
Sampler
(
self
.
fewshot_docs
(),
self
,
rnd
=
random
.
Random
())
# TODO: pass the correct docs in here
self
.
sampler
=
samplers
.
Sampler
(
list
(
self
.
fewshot_docs
()
)
,
self
,
rnd
=
random
.
Random
())
# TODO: pass the correct docs in here
def
download
(
self
,
data_dir
=
None
,
cache_dir
=
None
,
download_mode
=
None
):
def
download
(
self
,
data_dir
=
None
,
cache_dir
=
None
,
download_mode
=
None
):
"""Downloads and returns the task dataset.
"""Downloads and returns the task dataset.
...
@@ -275,7 +275,6 @@ class Task(abc.ABC):
...
@@ -275,7 +275,6 @@ class Task(abc.ABC):
fewshot_ctx
=
self
.
fewshot_context
(
fewshot_ctx
=
self
.
fewshot_context
(
doc
,
self
.
_config
.
num_fewshot
,
rnd
=
random
.
Random
()
doc
,
self
.
_config
.
num_fewshot
,
rnd
=
random
.
Random
()
)
)
# TODO: hardcoded for now: # of runs on each input to be 2. # TODO: we should override this if doing greedy gen so users don't waste time+compute
# TODO: hardcoded for now: # of runs on each input to be 2. # TODO: we should override this if doing greedy gen so users don't waste time+compute
inst
=
self
.
construct_requests
(
doc
=
doc
,
ctx
=
fewshot_ctx
,
metadata
=
(
self
.
_config
[
"task_name"
],
doc_id
,
1
))
inst
=
self
.
construct_requests
(
doc
=
doc
,
ctx
=
fewshot_ctx
,
metadata
=
(
self
.
_config
[
"task_name"
],
doc_id
,
1
))
...
@@ -372,7 +371,6 @@ class Task(abc.ABC):
...
@@ -372,7 +371,6 @@ class Task(abc.ABC):
if
num_fewshot
==
0
:
if
num_fewshot
==
0
:
labeled_examples
=
""
labeled_examples
=
""
else
:
else
:
labeled_examples
=
self
.
sampler
.
get_context
(
doc
,
self
.
_config
.
num_fewshot
)
labeled_examples
=
self
.
sampler
.
get_context
(
doc
,
self
.
_config
.
num_fewshot
)
# for sets with no training docs, draw from other set *but ensure no overlap with current doc*
# for sets with no training docs, draw from other set *but ensure no overlap with current doc*
...
...
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