Skip to content

Commit

Permalink
[Bugfix] Added Command-R GPTQ support (vllm-project#3849)
Browse files Browse the repository at this point in the history
Co-authored-by: Egor Tolmachev <[email protected]>
  • Loading branch information
egortolmachev and t3ga authored Apr 8, 2024
1 parent fee7c84 commit dd1a509
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vllm/model_executor/models/commandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,21 @@ def load_weights(
if shard_name not in name:
continue
name = name.replace(shard_name, param_name)
# Skip loading extra bias for GPTQ models.
if name.endswith(".bias") and name not in params_dict:
continue
param = params_dict[name]
weight_loader = param.weight_loader
weight_loader(param, loaded_weight, shard_id)
break
else:
# lm_head is not used in vllm as it is tied with embed_token.
# To prevent errors, skip loading lm_head.weight.
if "lm_head.weight" in name:
continue
# Skip loading extra bias for GPTQ models.
if name.endswith(".bias") and name not in params_dict:
continue
param = params_dict[name]
weight_loader = getattr(param, "weight_loader",
default_weight_loader)
Expand Down

0 comments on commit dd1a509

Please sign in to comment.