Skip to content

Commit 0678aa3

Browse files
committed
make strict and fallback_to_scratch args configurable to add support for partial checkpoint restore
1 parent ad9e0c9 commit 0678aa3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

t5x/train.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,11 @@ def _verify_matching_vocabs(cfg: utils.DatasetConfig):
354354
checkpoint_cfg.save and checkpoint_cfg.save.save_dataset
355355
),
356356
state_transformation_fns=state_transforms_for_restore,
357+
strict=(checkpoint_cfg.restore.strict
358+
if checkpoint_cfg.restore is not None else True
359+
),
360+
fallback_to_scratch=(checkpoint_cfg.restore.fallback_to_scratch
361+
if checkpoint_cfg.restore is not None else False)
357362
)
358363
]
359364
# 2. From a checkpoint specified by `checkpoint_cfg.restore.path`, if set.

0 commit comments

Comments
 (0)