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
50cc356c
Commit
50cc356c
authored
Jun 26, 2024
by
Nathan Habib
Browse files
batch commit
parent
137b5423
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tests/models/test_vllm.py
tests/models/test_vllm.py
+3
-2
No files found.
tests/models/test_vllm.py
View file @
50cc356c
from
typing
import
List
from
typing
import
List
import
pytest
import
pytest
import
torch
from
lm_eval
import
tasks
from
lm_eval
import
tasks
from
lm_eval.api.instance
import
Instance
from
lm_eval.api.instance
import
Instance
...
@@ -10,7 +11,7 @@ task_manager = tasks.TaskManager()
...
@@ -10,7 +11,7 @@ task_manager = tasks.TaskManager()
@
pytest
.
mark
.
skip
(
reason
=
"requires CUDA"
)
@
pytest
.
mark
.
skip
(
reason
=
"requires CUDA"
)
class
T
est
_VLLM
:
class
T
EST
_VLLM
:
vllm
=
pytest
.
importorskip
(
"vllm"
)
vllm
=
pytest
.
importorskip
(
"vllm"
)
try
:
try
:
from
lm_eval.models.vllm_causallms
import
VLLM
from
lm_eval.models.vllm_causallms
import
VLLM
...
@@ -18,7 +19,7 @@ class Test_VLLM:
...
@@ -18,7 +19,7 @@ class Test_VLLM:
LM
=
VLLM
(
pretrained
=
"EleutherAI/pythia-70m"
)
LM
=
VLLM
(
pretrained
=
"EleutherAI/pythia-70m"
)
except
ModuleNotFoundError
:
except
ModuleNotFoundError
:
pass
pass
#
torch.use_deterministic_algorithms(True)
torch
.
use_deterministic_algorithms
(
True
)
task_list
=
task_manager
.
load_task_or_group
([
"arc_easy"
,
"gsm8k"
,
"wikitext"
])
task_list
=
task_manager
.
load_task_or_group
([
"arc_easy"
,
"gsm8k"
,
"wikitext"
])
multiple_choice_task
=
task_list
[
"arc_easy"
]
# type: ignore
multiple_choice_task
=
task_list
[
"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
)
...
...
Prev
1
2
3
Next
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