mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-23 22:38:58 +06:00
Fix post_init() code duplication (#36727)
* Update modeling_utils.py * CIs
This commit is contained in:
parent
25992b493c
commit
2c2495cc7b
@ -1917,9 +1917,6 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
|
|||||||
for name, module in self.named_children():
|
for name, module in self.named_children():
|
||||||
if plan := getattr(module, "_tp_plan", None):
|
if plan := getattr(module, "_tp_plan", None):
|
||||||
self._tp_plan.update({f"{name}.{k}": v for k, v in plan.items()})
|
self._tp_plan.update({f"{name}.{k}": v for k, v in plan.items()})
|
||||||
for name, module in self.named_children():
|
|
||||||
if plan := getattr(module, "_tp_plan", None):
|
|
||||||
self._tp_plan.update({f"{name}.{k}": v for k, v in plan.items()})
|
|
||||||
|
|
||||||
if self._tp_plan is not None and is_torch_greater_or_equal("2.3"):
|
if self._tp_plan is not None and is_torch_greater_or_equal("2.3"):
|
||||||
for _, v in self._tp_plan.items():
|
for _, v in self._tp_plan.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user