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
40022d07
Unverified
Commit
40022d07
authored
Feb 06, 2025
by
Chayenne
Committed by
GitHub
Feb 06, 2025
Browse files
Feature: Fix the binding error in Llama (#3355)
parent
823148e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
python/sglang/srt/models/llama.py
python/sglang/srt/models/llama.py
+8
-3
No files found.
python/sglang/srt/models/llama.py
View file @
40022d07
...
@@ -476,9 +476,14 @@ class LlamaForCausalLM(nn.Module):
...
@@ -476,9 +476,14 @@ class LlamaForCausalLM(nn.Module):
# Skip loading kv_scale from ckpts towards new design.
# Skip loading kv_scale from ckpts towards new design.
if
name
.
endswith
(
".kv_scale"
)
and
name
not
in
params_dict
:
if
name
.
endswith
(
".kv_scale"
)
and
name
not
in
params_dict
:
continue
continue
param
=
params_dict
[
name
]
if
name
in
params_dict
.
keys
():
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
)
param
=
params_dict
[
name
]
weight_loader
(
param
,
loaded_weight
)
weight_loader
=
getattr
(
param
,
"weight_loader"
,
default_weight_loader
)
weight_loader
(
param
,
loaded_weight
)
else
:
logger
.
warning
(
f
"Parameter
{
name
}
not found in params_dict"
)
def
get_weights_by_name
(
def
get_weights_by_name
(
self
,
name
:
str
,
truncate_size
:
int
=
100
,
tp_size
:
int
=
1
self
,
name
:
str
,
truncate_size
:
int
=
100
,
tp_size
:
int
=
1
...
...
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