Fix backward compatibility with EvaluationStrategy (#10718)

This commit is contained in:
Sylvain Gugger 2021-03-15 10:20:38 -04:00 committed by GitHub
parent d9e693e1d0
commit f5c097fc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -526,6 +526,8 @@ class TrainingArguments:
"using `EvaluationStrategy` for `evaluation_strategy` is deprecated and will be removed in version 5 of 🤗 Transformers. Use `IntervalStrategy` instead",
FutureWarning,
)
# Go back to the underlying string or we won't be able to instantiate `IntervalStrategy` on it.
self.evaluation_strategy = self.evaluation_strategy.value
self.evaluation_strategy = IntervalStrategy(self.evaluation_strategy)
self.logging_strategy = IntervalStrategy(self.logging_strategy)