"vscode:/vscode.git/clone" did not exist on "c6f36cfa2642486ba2c2e5d62be0467fe1c036f9"
Unverified Commit 0af4d764 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Fix weight loading for some models in Transformers backend (#15544)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent e64afa45
......@@ -345,9 +345,11 @@ class TransformersModel(nn.Module):
params_dict = dict(self.named_parameters())
loaded_params = set[str]()
for name, loaded_weight in weights:
# Necessary for some models which use remote code
if not name.startswith(prefix := self.model.base_model_prefix):
name = maybe_prefix(prefix, name)
# Use "model" instead of base_model_prefix because
# the base model attribute in vLLM is always `model`
if not name.startswith(prefix := "model."):
name = prefix + name
if is_pp_missing_parameter(name, self):
continue
if name in params_dict:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment