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
4026a049
"torchvision/vscode:/vscode.git/clone" did not exist on "20414024d730677da60ccb7841f5e96aec6e1c9e"
Unverified
Commit
4026a049
authored
Jun 27, 2023
by
twaka
Committed by
GitHub
Jun 27, 2023
Browse files
expand coverage of gpt2 model loading (#271)
parent
43710e8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vllm/model_executor/models/gpt2.py
vllm/model_executor/models/gpt2.py
+4
-2
No files found.
vllm/model_executor/models/gpt2.py
View file @
4026a049
...
@@ -228,10 +228,12 @@ class GPT2LMHeadModel(nn.Module):
...
@@ -228,10 +228,12 @@ class GPT2LMHeadModel(nn.Module):
# GPT-2 ties the weights of the embedding layer and the final
# GPT-2 ties the weights of the embedding layer and the final
# linear layer.
# linear layer.
continue
continue
if
".attn.bias"
in
name
:
if
".attn.bias"
in
name
or
".attn.masked_bias"
in
name
:
# Skip attention mask.
# Skip attention mask.
# NOTE: "c_attn.bias" should not be skipped.
# NOTE: "c_attn.bias" should not be skipped.
continue
continue
if
not
name
.
startswith
(
"transformer."
):
name
=
"transformer."
+
name
name
=
"transformer."
+
name
# The HF's GPT-2 implementation uses Conv1D instead of Linear.
# The HF's GPT-2 implementation uses Conv1D instead of Linear.
...
...
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