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
2c20df08
Commit
2c20df08
authored
Nov 27, 2023
by
baberabb
Browse files
lazy load import in tests
parent
026005ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
tests/models/test_vllm.py
tests/models/test_vllm.py
+7
-3
No files found.
tests/models/test_vllm.py
View file @
2c20df08
import
pytest
from
typing
import
List
from
lm_eval.models.vllm_causallms
import
VLLM
from
lm_eval.api.instance
import
Instance
import
lm_eval.tasks
as
tasks
import
sys
import
torch
@
pytest
.
skip
(
reason
=
"requires CUDA"
)
@
pytest
.
mark
.
skip
(
reason
=
"requires CUDA"
)
class
TEST_VLLM
:
try
:
from
lm_eval.models.vllm_causallms
import
VLLM
LM
=
VLLM
(
pretrained
=
"EleutherAI/pythia-70m"
)
except
ModuleNotFoundError
:
pass
torch
.
use_deterministic_algorithms
(
True
)
tasks
.
initialize_tasks
()
LM
=
VLLM
(
pretrained
=
"EleutherAI/pythia-70m"
)
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_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