Fix OPT param names (#1819)

This commit is contained in:
Woosuk Kwon 2023-11-28 11:22:44 -08:00 committed by GitHub
parent a1125ad4df
commit b943890484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,6 +331,9 @@ class OPTForCausalLM(nn.Module):
model_name_or_path, cache_dir, load_format, revision):
if "lm_head.weight" in name:
continue
if name.startswith("decoder."):
name = "model." + name
for (param_name, weight_name, shard_id) in stacked_params_mapping:
if weight_name not in name:
continue