Skip to content

Commit

Permalink
[training] SAVE_STATE_WARNING was removed in pytorch
Browse files Browse the repository at this point in the history
FYI `SAVE_STATE_WARNING` has been removed 3 days ago: pytorch/pytorch#46813

Fixes: #8232

@sgugger
  • Loading branch information
stas00 committed Dec 8, 2020
1 parent 2ae7388 commit 9f66366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/trainer_pt_utils.py
Expand Up @@ -34,7 +34,8 @@
if is_torch_tpu_available():
import torch_xla.core.xla_model as xm

if version.parse(torch.__version__) <= version.parse("1.4.1"):
# this is used to supress an undesired warning emitted by pytorch versions 1.4.2-1.7.0
if version.parse(torch.__version__) <= version.parse("1.4.1") or version.parse(torch.__version__) > version.parse("1.7.0"):
SAVE_STATE_WARNING = ""
else:
from torch.optim.lr_scheduler import SAVE_STATE_WARNING
Expand Down

0 comments on commit 9f66366

Please sign in to comment.