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
norm
vllm
Commits
dbed6905
Unverified
Commit
dbed6905
authored
Jul 14, 2023
by
Wen Sun
Committed by
GitHub
Jul 13, 2023
Browse files
Fix the `KeyError` when loading bloom-based models (#441)
parent
7b6ae940
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
vllm/model_executor/models/bloom.py
vllm/model_executor/models/bloom.py
+10
-3
No files found.
vllm/model_executor/models/bloom.py
View file @
dbed6905
...
@@ -284,10 +284,17 @@ class BloomForCausalLM(nn.Module):
...
@@ -284,10 +284,17 @@ class BloomForCausalLM(nn.Module):
state_dict
=
self
.
state_dict
()
state_dict
=
self
.
state_dict
()
for
name
,
loaded_weight
in
hf_model_weights_iterator
(
for
name
,
loaded_weight
in
hf_model_weights_iterator
(
model_name_or_path
,
cache_dir
,
use_np_cache
):
model_name_or_path
,
cache_dir
,
use_np_cache
):
if
not
name
.
startswith
(
"transformer."
):
if
name
==
"lm_head.weight"
:
name
=
"transformer."
+
name
# Since hidden_states are parallelized, we need to
# load lm_head.weight in parallel.
self
.
_column_parallel_weights
.
append
(
name
)
# If lm_head is provided, use it instead.
param
=
self
.
lm_head_weight
else
:
if
not
name
.
startswith
(
"transformer."
):
name
=
"transformer."
+
name
param
=
state_dict
[
name
]
param
=
state_dict
[
name
]
if
"query_key_value"
in
name
:
if
"query_key_value"
in
name
:
# NOTE(woosuk): BLOOM's fused QKV has the shape of
# NOTE(woosuk): BLOOM's fused QKV has the shape of
# [num_heads * 3 * head_size, hidden_size], while the
# [num_heads * 3 * head_size, hidden_size], while the
...
...
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