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
4e2d1498
"git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "c827c671f74438b32243d2d9add27cdf29511ab0"
Commit
4e2d1498
authored
Oct 05, 2020
by
sdtblck
Browse files
add download method to base class
parent
ff2d2ada
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lm_eval/base.py
lm_eval/base.py
+7
-1
No files found.
lm_eval/base.py
View file @
4e2d1498
...
@@ -54,6 +54,12 @@ class LM(abc.ABC):
...
@@ -54,6 +54,12 @@ class LM(abc.ABC):
class
Dataset
(
abc
.
ABC
):
class
Dataset
(
abc
.
ABC
):
@
abc
.
abstractmethod
def
download
(
self
):
"""Downloads the task dataset if necessary"""
pass
@
abc
.
abstractmethod
@
abc
.
abstractmethod
def
has_training_docs
(
self
):
def
has_training_docs
(
self
):
"""Whether the task has a training set"""
"""Whether the task has a training set"""
...
@@ -121,4 +127,4 @@ class Dataset(abc.ABC):
...
@@ -121,4 +127,4 @@ class Dataset(abc.ABC):
map
(
self
.
doc_to_text
,
self
.
fewshot_examples
(
k
=
num_fewshot
))
map
(
self
.
doc_to_text
,
self
.
fewshot_examples
(
k
=
num_fewshot
))
)
+
"
\n\n
"
)
+
"
\n\n
"
example
=
self
.
doc_to_text
(
doc
,
include_target
=
False
).
strip
()
example
=
self
.
doc_to_text
(
doc
,
include_target
=
False
).
strip
()
return
description
+
labeled_examples
+
example
return
description
+
labeled_examples
+
example
\ No newline at end of file
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