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
f1e62d36
Commit
f1e62d36
authored
Sep 05, 2023
by
baberabb
Browse files
added torch deterministic
parent
6cc1ae7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/models/test_huggingface.py
tests/models/test_huggingface.py
+2
-1
No files found.
tests/models/test_huggingface.py
View file @
f1e62d36
...
@@ -4,10 +4,11 @@ import numpy as np
...
@@ -4,10 +4,11 @@ import numpy as np
from
lm_eval.models.huggingface
import
HFLM
from
lm_eval.models.huggingface
import
HFLM
from
lm_eval.api.instance
import
Instance
from
lm_eval.api.instance
import
Instance
import
lm_eval.tasks
as
tasks
import
lm_eval.tasks
as
tasks
import
torch
class
Test_HFLM
:
class
Test_HFLM
:
torch
.
use_deterministic_algorithms
(
True
)
multiple_choice_task
=
tasks
.
TASK_REGISTRY
.
get
(
"arc_easy"
)()
# type: ignore
multiple_choice_task
=
tasks
.
TASK_REGISTRY
.
get
(
"arc_easy"
)()
# type: ignore
multiple_choice_task
.
build_all_requests
(
limit
=
10
,
rank
=
0
,
world_size
=
1
)
multiple_choice_task
.
build_all_requests
(
limit
=
10
,
rank
=
0
,
world_size
=
1
)
MULTIPLE_CH
:
list
[
Instance
]
=
multiple_choice_task
.
instances
MULTIPLE_CH
:
list
[
Instance
]
=
multiple_choice_task
.
instances
...
...
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