Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
3e073e66
Unverified
Commit
3e073e66
authored
Sep 25, 2024
by
sohamparikh
Committed by
GitHub
Sep 24, 2024
Browse files
[Bugfix] load fc bias from config for eagle (#8790)
parent
c2395367
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
vllm/model_executor/models/eagle.py
vllm/model_executor/models/eagle.py
+10
-2
No files found.
vllm/model_executor/models/eagle.py
View file @
3e073e66
...
...
@@ -44,7 +44,7 @@ class EAGLE(nn.Module):
self
.
model
=
model_cls
(
self
.
config
.
model
,
*
args
,
**
kwargs
)
self
.
fc
=
nn
.
Linear
(
config
.
model
.
hidden_size
*
2
,
config
.
model
.
hidden_size
,
bias
=
False
)
bias
=
getattr
(
self
.
config
,
"bias"
,
False
)
)
self
.
orig_vocab_size
=
config
.
vocab_size
self
.
truncated_vocab_size
=
config
.
truncated_vocab_size
...
...
@@ -136,10 +136,18 @@ class EAGLE(nn.Module):
if
self
.
config
.
truncated_vocab_size
<
self
.
config
.
vocab_size
:
self
.
token_map
=
nn
.
Parameter
(
loaded_weight
,
requires_grad
=
False
)
elif
name
.
startswith
(
"fc."
):
elif
name
.
startswith
(
"fc.
weight
"
):
weight_loader
=
getattr
(
self
.
fc
.
weight
,
"weight_loader"
,
default_weight_loader
)
weight_loader
(
self
.
fc
.
weight
,
loaded_weight
)
elif
name
.
startswith
(
"fc.bias"
):
if
self
.
fc
.
bias
is
not
None
:
weight_loader
=
getattr
(
self
.
fc
.
bias
,
"weight_loader"
,
default_weight_loader
)
weight_loader
(
self
.
fc
.
bias
,
loaded_weight
)
else
:
raise
ValueError
(
"Found bias in the loaded weights "
"but the model config doesn't have bias"
)
elif
name
.
startswith
(
"model.lm_head."
)
or
name
.
startswith
(
"model.model."
):
model_weights
[
name
.
split
(
"model."
,
1
)[
-
1
]]
=
loaded_weight
...
...
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