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
055d99b5
Commit
055d99b5
authored
Nov 29, 2023
by
baberabb
Browse files
rename function
parent
9850c745
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lm_eval/models/vllm_causallms.py
lm_eval/models/vllm_causallms.py
+3
-2
No files found.
lm_eval/models/vllm_causallms.py
View file @
055d99b5
...
@@ -18,7 +18,8 @@ except ModuleNotFoundError:
...
@@ -18,7 +18,8 @@ except ModuleNotFoundError:
eval_logger
=
utils
.
eval_logger
eval_logger
=
utils
.
eval_logger
def
run_inference_one_gpu
(
model_args
:
dict
,
sampling_params
,
requests
:
List
[
int
]):
# adapter from https://github.com/vllm-project/vllm/issues/367#issuecomment-1788341727
def
run_inference_one_model
(
model_args
:
dict
,
sampling_params
,
requests
:
List
[
int
]):
# gpu_id = [x for x in gpu_id]
# gpu_id = [x for x in gpu_id]
# os.environ["CUDA_VISIBLE_DEVICES"]= str(gpu_id)
# os.environ["CUDA_VISIBLE_DEVICES"]= str(gpu_id)
llm
=
LLM
(
**
model_args
)
llm
=
LLM
(
**
model_args
)
...
@@ -149,7 +150,7 @@ please install vllm via `pip install lm-eval[vllm]` or `pip install -e .[vllm]`"
...
@@ -149,7 +150,7 @@ please install vllm via `pip install lm-eval[vllm]` or `pip install -e .[vllm]`"
inputs
=
[(
self
.
model_args
,
sampling_params
,
req
)
for
req
in
requests
]
inputs
=
[(
self
.
model_args
,
sampling_params
,
req
)
for
req
in
requests
]
with
Pool
(
self
.
data_parallel
)
as
pool
:
with
Pool
(
self
.
data_parallel
)
as
pool
:
results
=
pool
.
starmap
(
run_inference_one_
gpu
,
inputs
)
results
=
pool
.
starmap
(
run_inference_one_
model
,
inputs
)
# flatten results
# flatten results
return
[
item
for
sublist
in
results
for
item
in
sublist
]
return
[
item
for
sublist
in
results
for
item
in
sublist
]
...
...
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