Remove deprecated codes (#24837)

* remove `xpu_backend` training argument

* always call `contextlib.nullcontext()` since transformers updated to
python3.8

* these codes will not be executed
This commit is contained in:
statelesshz
2023-07-18 02:45:59 +08:00
committed by GitHub
parent eeaa9c016a
commit 0f4502d335
2 changed files with 2 additions and 31 deletions

View File

@@ -1189,14 +1189,6 @@ class TrainingArguments:
},
)
xpu_backend: Optional[str] = field(
default=None,
metadata={
"help": "The backend to be used for distributed training on Intel XPU.",
"choices": ["mpi", "ccl", "gloo"],
},
)
def __post_init__(self):
# expand paths, if not os.makedirs("~/bar") will make directory
# in the current directory instead of the actual home
@@ -1220,14 +1212,6 @@ class TrainingArguments:
# Go back to the underlying string or we won't be able to instantiate `IntervalStrategy` on it.
self.evaluation_strategy = self.evaluation_strategy.value
if self.xpu_backend is not None:
warnings.warn(
"using `xpu_backend` is deprecated and will be removed in version 4.31"
" of 🤗 Transformers. Use `ddp_backend` instead",
FutureWarning,
)
self.ddp_backend = self.xpu_backend
self.evaluation_strategy = IntervalStrategy(self.evaluation_strategy)
self.logging_strategy = IntervalStrategy(self.logging_strategy)
self.save_strategy = IntervalStrategy(self.save_strategy)