Fix all import errors based on older torch versions (#38370)

* Update masking_utils.py

* fix

* fix

* fix

* Update masking_utils.py

* Update executorch.py

* fix
This commit is contained in:
Cyril Vallez
2025-05-26 12:11:54 +02:00
committed by GitHub
parent d03a3ca692
commit 9f0402bc4d
2 changed files with 20 additions and 15 deletions

View File

@@ -2078,7 +2078,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, PushToHubMixin, PeftAdapterMi
if plan := getattr(module, "_tp_plan", None):
self._tp_plan.update({f"{name}.{k}": v for k, v in plan.copy().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.5"):
for _, v in self._tp_plan.items():
if v not in ALL_PARALLEL_STYLES:
raise ValueError(