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
aeb7e846
Commit
aeb7e846
authored
Apr 21, 2022
by
Dirk Groeneveld
Browse files
There is no point in passing in a RNG if you're re-seeding it every time anyways.
parent
7ab64701
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
lm_eval/tasks/hendrycks_ethics.py
lm_eval/tasks/hendrycks_ethics.py
+4
-6
No files found.
lm_eval/tasks/hendrycks_ethics.py
View file @
aeb7e846
...
@@ -277,20 +277,18 @@ class EthicsUtilitarianism(Ethics):
...
@@ -277,20 +277,18 @@ class EthicsUtilitarianism(Ethics):
DATASET_NAME
=
"utilitarianism"
DATASET_NAME
=
"utilitarianism"
def
training_docs
(
self
):
def
training_docs
(
self
):
rnd
=
random
.
Random
()
for
doc
in
self
.
dataset
[
"train"
]:
for
doc
in
self
.
dataset
[
"train"
]:
yield
self
.
_process_doc
(
doc
,
rnd
)
yield
self
.
_process_doc
(
doc
)
def
validation_docs
(
self
):
def
validation_docs
(
self
):
raise
NotImplementedError
raise
NotImplementedError
def
test_docs
(
self
):
def
test_docs
(
self
):
rnd
=
random
.
Random
()
for
doc
in
self
.
dataset
[
"test"
]:
for
doc
in
self
.
dataset
[
"test"
]:
yield
self
.
_process_doc
(
doc
,
rnd
)
yield
self
.
_process_doc
(
doc
)
def
_process_doc
(
self
,
doc
,
rnd
):
def
_process_doc
(
self
,
doc
):
rnd
.
seed
(
doc
[
"activity"
])
rnd
=
random
.
Random
(
doc
[
"activity"
])
scenarios
=
[
doc
[
"activity"
],
doc
[
"baseline"
]]
scenarios
=
[
doc
[
"activity"
],
doc
[
"baseline"
]]
ordering
=
[
0
,
1
]
ordering
=
[
0
,
1
]
rnd
.
shuffle
(
ordering
)
rnd
.
shuffle
(
ordering
)
...
...
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