nshtrainer 1.0.0b53__py3-none-any.whl → 1.0.0b54__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -457,7 +457,21 @@ class Trainer(LightningTrainer):
457
457
  ):
458
458
  filepath = Path(filepath)
459
459
 
460
- super().save_checkpoint(filepath, weights_only, storage_options)
460
+ if self.model is None:
461
+ raise AttributeError(
462
+ "Saving a checkpoint is only possible if a model is attached to the Trainer. Did you call"
463
+ " `Trainer.save_checkpoint()` before calling `Trainer.{fit,validate,test,predict}`?"
464
+ )
465
+ with self.profiler.profile("save_checkpoint"): # type: ignore
466
+ checkpoint = self._checkpoint_connector.dump_checkpoint(weights_only)
467
+ # Update the checkpoint for the trainer hyperparameters
468
+ checkpoint[self.CHECKPOINT_HYPER_PARAMS_KEY] = self.hparams.model_dump(
469
+ mode="json"
470
+ )
471
+ self.strategy.save_checkpoint(
472
+ checkpoint, filepath, storage_options=storage_options
473
+ )
474
+ self.strategy.barrier("Trainer.save_checkpoint")
461
475
 
462
476
  # Save the checkpoint metadata
463
477
  metadata_path = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nshtrainer
3
- Version: 1.0.0b53
3
+ Version: 1.0.0b54
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -142,7 +142,7 @@ nshtrainer/trainer/plugin/layer_sync.py,sha256=h-ydZwXepnsw5-paLgiDatqPyQ_8C0QEv
142
142
  nshtrainer/trainer/plugin/precision.py,sha256=I0QsB1bVxmsFmBOkgrAfGONsuYae_lD9Bz0PfJEQvH4,5598
143
143
  nshtrainer/trainer/signal_connector.py,sha256=GhfGcSzfaTNhnj2QFkBDq5aT7FqbLMA7eC8SYQs8_8w,10828
144
144
  nshtrainer/trainer/strategy.py,sha256=VPTn5z3zvXTydY8IJchjhjcOfpvtoejnvUkq5E4WTus,1368
145
- nshtrainer/trainer/trainer.py,sha256=QEK-0bcw1y5Cconi99PYFXr0MElUGgGYMZ_SlcJUQ1k,20364
145
+ nshtrainer/trainer/trainer.py,sha256=Lo3vUo3ooTAjaX2fUYPFSMv5FP7sWfVov0QbA-T5hZ8,21113
146
146
  nshtrainer/util/_environment_info.py,sha256=MT8mBe6ZolRfKiwU-les1P-lPNPqXpHQcfADrh_A3uY,24629
147
147
  nshtrainer/util/bf16.py,sha256=9QhHZCkYSfYpIcxwAMoXyuh2yTSHBzT-EdLQB297jEs,762
148
148
  nshtrainer/util/config/__init__.py,sha256=Z39JJufSb61Lhn2GfVcv3eFW_eorOrN9-9llDWlnZZM,272
@@ -154,6 +154,6 @@ nshtrainer/util/seed.py,sha256=diMV8iwBKN7Xxt5pELmui-gyqyT80_CZzomrWhNss0k,316
154
154
  nshtrainer/util/slurm.py,sha256=HflkP5iI_r4UHMyPjw9R4dD5AHsJUpcfJw5PLvGYBRM,1603
155
155
  nshtrainer/util/typed.py,sha256=Xt5fUU6zwLKSTLUdenovnKK0N8qUq89Kddz2_XeykVQ,164
156
156
  nshtrainer/util/typing_utils.py,sha256=MjY-CUX9R5Tzat-BlFnQjwl1PQ_W2yZQoXhkYHlJ_VA,442
157
- nshtrainer-1.0.0b53.dist-info/METADATA,sha256=xzPw_zTWp8gLpzKhvcAHTv8KbZCvxwMU_MIzMiq8j78,988
158
- nshtrainer-1.0.0b53.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
159
- nshtrainer-1.0.0b53.dist-info/RECORD,,
157
+ nshtrainer-1.0.0b54.dist-info/METADATA,sha256=oSfrN2tgKgkZJwGbZVNbLULQcVMxh_wb02u7Hrujfn4,988
158
+ nshtrainer-1.0.0b54.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
159
+ nshtrainer-1.0.0b54.dist-info/RECORD,,