Skip to content

Commit 19132c5

Browse files
wtmlonJonathans575
andauthored
fix uc tp name mapping. (#2502)
Co-authored-by: Jonathans575 <[email protected]>
1 parent 561dd68 commit 19132c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddleformers/peft/lora/lora_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def _get_tensor_parallel_mappings(self, config, is_split=True):
212212
single_name = [prefixes[idx]]
213213
single_name.extend(name_splited[1:])
214214
elif "shared_layers" in idx:
215-
single_name = re.sub(r"^shared_layers.embed_weight_share.", "ernie.", k)
215+
single_name = ["ernie"]
216+
single_name.extend(k.split("shared_layers.embed_weight_share.")[1:])
216217
else:
217218
raise ValueError(f"Unexpected key: {k} for pp lora layer.")
218219
rename_lora_split_mapping[".".join(single_name)] = self.lora_split_mapping[k]

0 commit comments

Comments
 (0)