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
6a78fdaf
Unverified
Commit
6a78fdaf
authored
Mar 25, 2021
by
Leo Gao
Committed by
GitHub
Mar 25, 2021
Browse files
Deterministic fewshot_experiments
parent
283b2c5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lm_eval/base.py
lm_eval/base.py
+3
-1
No files found.
lm_eval/base.py
View file @
6a78fdaf
...
@@ -117,7 +117,9 @@ class Task(abc.ABC):
...
@@ -117,7 +117,9 @@ class Task(abc.ABC):
def
fewshot_examples
(
self
,
k
):
def
fewshot_examples
(
self
,
k
):
if
self
.
_training_docs
is
None
:
if
self
.
_training_docs
is
None
:
self
.
_training_docs
=
list
(
self
.
training_docs
())
self
.
_training_docs
=
list
(
self
.
training_docs
())
return
random
.
sample
(
self
.
_training_docs
,
k
)
rnd
=
random
.
Random
()
rnd
.
seed
(
42
)
return
rnd
.
sample
(
self
.
_training_docs
,
k
)
@
abc
.
abstractmethod
@
abc
.
abstractmethod
def
doc_to_text
(
self
,
doc
):
def
doc_to_text
(
self
,
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