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
change
sglang
Commits
fe3be159
".github/vscode:/vscode.git/clone" did not exist on "0d7c4790235ac00b4524b492bc2a680dcc5cf6b0"
Unverified
Commit
fe3be159
authored
Jul 17, 2024
by
ylying
Committed by
GitHub
Jul 16, 2024
Browse files
Add qwen2 tie word embedding (#630)
parent
0aa189f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
python/sglang/srt/models/qwen2.py
python/sglang/srt/models/qwen2.py
+2
-0
No files found.
python/sglang/srt/models/qwen2.py
View file @
fe3be159
...
@@ -313,6 +313,8 @@ class Qwen2ForCausalLM(nn.Module):
...
@@ -313,6 +313,8 @@ class Qwen2ForCausalLM(nn.Module):
param
=
params_dict
[
name
]
param
=
params_dict
[
name
]
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
)
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
)
weight_loader
(
param
,
loaded_weight
)
weight_loader
(
param
,
loaded_weight
)
if
self
.
config
.
tie_word_embeddings
and
name
==
"model.embed_tokens.weight"
:
weight_loader
(
params_dict
[
"lm_head.weight"
],
loaded_weight
)
EntryClass
=
Qwen2ForCausalLM
EntryClass
=
Qwen2ForCausalLM
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