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
xdb4_94051
vllm
Commits
875afe38
Unverified
Commit
875afe38
authored
Oct 12, 2023
by
Woosuk Kwon
Committed by
GitHub
Oct 12, 2023
Browse files
Add blacklist in model checkpoint (#1325)
parent
ee8217e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
vllm/model_executor/weight_utils.py
vllm/model_executor/weight_utils.py
+11
-1
No files found.
vllm/model_executor/weight_utils.py
View file @
875afe38
...
...
@@ -144,8 +144,18 @@ def prepare_hf_model_weights(
for
pattern
in
allow_patterns
:
hf_weights_files
+=
glob
.
glob
(
os
.
path
.
join
(
hf_folder
,
pattern
))
if
not
use_safetensors
:
# Exclude files that are not needed for inference.
# https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/trainer.py#L227-L233
blacklist
=
[
"training_args.bin"
,
"optimizer.bin"
,
"optimizer.pt"
,
"scheduler.pt"
,
"scaler.pt"
,
]
hf_weights_files
=
[
x
for
x
in
hf_weights_files
if
not
x
.
endswith
(
"training_args.bin"
)
f
for
f
in
hf_weights_files
if
not
any
(
f
.
endswith
(
x
)
for
x
in
blacklist
)
]
if
len
(
hf_weights_files
)
==
0
and
use_safetensors
and
fall_back_to_pt
:
...
...
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