Skip to content

Commit 9354b3e

Browse files
committed
fix: fix the bug in transformers.model_utils.PretrainedModel.recompute_disable()
1 parent c83684f commit 9354b3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddlenlp/transformers/model_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,8 +1360,8 @@ def recompute_disable(self):
13601360
"""
13611361

13621362
def fn(layer):
1363-
if hasattr(layer, "enable_recompute") and (layer.enable_recompute is False or layer.enable_recompute == 0):
1364-
layer.enable_recompute = True
1363+
if hasattr(layer, "enable_recompute") and (layer.enable_recompute is True or layer.enable_recompute == 1):
1364+
layer.enable_recompute = False
13651365

13661366
self.apply(fn)
13671367

0 commit comments

Comments
 (0)