Skip to content

Commit

Permalink
Remove running validating after finetuning (NVIDIA#10560)
Browse files Browse the repository at this point in the history
* remove running validating after finetuning

* Apply isort and black reformatting

Signed-off-by: huvunvidia <huvunvidia@users.noreply.github.com>

---------

Signed-off-by: huvunvidia <huvunvidia@users.noreply.github.com>
Co-authored-by: Huy Vu2 <huvu@login-eos01.eos.clusters.nvidia.com>
Co-authored-by: huvunvidia <huvunvidia@users.noreply.github.com>
  • Loading branch information
3 people authored and Rachit Garg committed Sep 26, 2024
1 parent ee3a7ef commit e5de82c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ def load_from_checkpoint_dir(cls, cfg, trainer, modify_confg_fn):
t5_cfg = modify_confg_fn(hparams_file.cfg, cfg, add_cfg_to_tree=True)
with tempfile.NamedTemporaryFile(suffix='.yaml') as f:
OmegaConf.save(config=t5_cfg, f=f.name)
model = cls.load_from_checkpoint(checkpoint_path=checkpoint_path, trainer=trainer, hparams_file=f.name,)
model = cls.load_from_checkpoint(
checkpoint_path=checkpoint_path,
trainer=trainer,
hparams_file=f.name,
)
return model


Expand Down Expand Up @@ -162,7 +166,7 @@ def main(cfg) -> None:
scaler = None
if cfg.trainer.precision in [16, '16', '16-mixed']:
scaler = GradScaler(
init_scale=cfg.model.get('native_amp_init_scale', 2 ** 32),
init_scale=cfg.model.get('native_amp_init_scale', 2**32),
growth_interval=cfg.model.get('native_amp_growth_interval', 1000),
hysteresis=cfg.model.get('hysteresis', 2),
)
Expand Down Expand Up @@ -223,7 +227,6 @@ def main(cfg) -> None:
model = load_from_checkpoint_dir(MegatronT5SFTModel, cfg, trainer, modify_confg_fn=_modify_config)

trainer.fit(model)
trainer.validate(model)
if hasattr(cfg.model.data, 'test_ds'):
trainer.test(model)

Expand Down

0 comments on commit e5de82c

Please sign in to comment.