kostyl-toolkit 0.1.32__py3-none-any.whl → 0.1.33__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.
@@ -301,7 +301,7 @@ def setup_checkpoint_callback(
301
301
  ckpt_cfg: CheckpointConfig,
302
302
  save_weights_only: bool = True,
303
303
  registry_uploader_callback: RegistryUploaderCallback | None = None,
304
- uploading_mode: Literal["only-best", "every-checkpoint"] | None = None,
304
+ uploading_strategy: Literal["only-best", "every-checkpoint"] | None = None,
305
305
  ) -> ModelCheckpointWithRegistryUploader | ModelCheckpoint:
306
306
  """
307
307
  Create and configure a checkpoint callback for model saving.
@@ -316,8 +316,8 @@ def setup_checkpoint_callback(
316
316
  save_weights_only: If True, only model weights are saved without optimizer and lr-scheduler state.
317
317
  Defaults to True.
318
318
  registry_uploader_callback: Optional callback for uploading checkpoints to a remote registry.
319
- Must be specified together with uploading_mode.
320
- uploading_mode: Checkpoint upload mode:
319
+ Must be specified together with uploading_strategy.
320
+ uploading_strategy: Checkpoint upload mode:
321
321
  - "only-best": only the best checkpoint is uploaded
322
322
  - "every-checkpoint": every saved checkpoint is uploaded
323
323
  Must be specified together with registry_uploader_callback.
@@ -334,7 +334,7 @@ def setup_checkpoint_callback(
334
334
  (only on the main process in distributed training).
335
335
 
336
336
  """
337
- if (registry_uploader_callback is None) != (uploading_mode is None):
337
+ if (registry_uploader_callback is None) != (uploading_strategy is None):
338
338
  raise ValueError(
339
339
  "Both registry_uploader_callback and uploading_mode must be provided or neither."
340
340
  )
@@ -348,7 +348,7 @@ def setup_checkpoint_callback(
348
348
  logger.info(f"Creating checkpoint directory {dirpath}.")
349
349
  dirpath.mkdir(parents=True, exist_ok=True)
350
350
 
351
- if (registry_uploader_callback is not None) and (uploading_mode is not None):
351
+ if (registry_uploader_callback is not None) and (uploading_strategy is not None):
352
352
  checkpoint_callback = ModelCheckpointWithRegistryUploader(
353
353
  dirpath=dirpath,
354
354
  filename=ckpt_cfg.filename,
@@ -358,7 +358,7 @@ def setup_checkpoint_callback(
358
358
  verbose=True,
359
359
  save_weights_only=save_weights_only,
360
360
  registry_uploader_callback=registry_uploader_callback,
361
- uploading_mode=uploading_mode,
361
+ uploading_mode=uploading_strategy,
362
362
  )
363
363
  else:
364
364
  checkpoint_callback = ModelCheckpoint(
@@ -98,9 +98,9 @@ def setup_callbacks(
98
98
  task: Task,
99
99
  root_path: Path,
100
100
  checkpoint_cfg: CheckpointConfig,
101
- uploading_mode: Literal["only-best", "every-checkpoint"],
101
+ early_stopping_cfg: EarlyStoppingConfig | None,
102
102
  output_model: OutputModel,
103
- early_stopping_cfg: EarlyStoppingConfig | None = None,
103
+ checkpoint_upload_strategy: Literal["only-best", "every-checkpoint"],
104
104
  config_dict: dict[str, str] | None = None,
105
105
  enable_tag_versioning: bool = False,
106
106
  ) -> Callbacks:
@@ -114,7 +114,7 @@ def setup_callbacks(
114
114
  task: ClearML task for organizing checkpoints by task name and ID.
115
115
  root_path: Root directory for saving checkpoints.
116
116
  checkpoint_cfg: Configuration for checkpoint saving behavior.
117
- uploading_mode: Model upload strategy:
117
+ checkpoint_upload_strategy: Model upload strategy:
118
118
  - `"only-best"`: Upload only the best checkpoint based on monitored metric.
119
119
  - `"every-checkpoint"`: Upload every saved checkpoint.
120
120
  output_model: ClearML OutputModel instance for model registry integration.
@@ -143,7 +143,7 @@ def setup_callbacks(
143
143
  root_path / "checkpoints" / task.name / task.id,
144
144
  checkpoint_cfg,
145
145
  registry_uploader_callback=model_uploader,
146
- uploading_mode=uploading_mode,
146
+ uploading_strategy=checkpoint_upload_strategy,
147
147
  )
148
148
  if early_stopping_cfg is not None:
149
149
  early_stopping_callback = setup_early_stopping_callback(early_stopping_cfg)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kostyl-toolkit
3
- Version: 0.1.32
3
+ Version: 0.1.33
4
4
  Summary: Kickass Orchestration System for Training, Yielding & Logging
5
5
  Requires-Dist: case-converter>=1.2.0
6
6
  Requires-Dist: loguru>=0.7.3
@@ -12,14 +12,14 @@ kostyl/ml/data_processing_utils.py,sha256=jjEjV0S0wREgZkzg27ip0LpI8cQqkwe2QwATmA
12
12
  kostyl/ml/dist_utils.py,sha256=Onf0KHVLA8oeUgZTcTdmR9qiM22f2uYLoNwgLbMGJWk,3495
13
13
  kostyl/ml/lightning/__init__.py,sha256=R36PImjVvzBF9t_z9u6RYVnUFJJ-sNDUOdboWUojHmM,173
14
14
  kostyl/ml/lightning/callbacks/__init__.py,sha256=EnKkNwwNDZnEqKRlpY4FVrqP88ECPF6nlT2bSLUIKRk,194
15
- kostyl/ml/lightning/callbacks/checkpoint.py,sha256=t3bfJH1HhWFA2tFArCaDe5BshFAaJ6-LRlQx5y5eOh8,18959
15
+ kostyl/ml/lightning/callbacks/checkpoint.py,sha256=sZ9OqudO-gXp7FqtWaOH46TXVpeCJxV-EowyRPN836k,18983
16
16
  kostyl/ml/lightning/callbacks/early_stopping.py,sha256=D5nyjktCJ9XYAf28-kgXG8jORvXLl1N3nbDQnvValPM,615
17
17
  kostyl/ml/lightning/extensions/__init__.py,sha256=OY6QGv1agYgqqKf1xJBrxgp_i8FunVfPzYezfaRrGXU,182
18
18
  kostyl/ml/lightning/extensions/custom_module.py,sha256=iQrnPz-WTmRfvLo94C5fQc2Qwa1IpHtUh1sCpVwTSFM,6602
19
19
  kostyl/ml/lightning/extensions/pretrained_model.py,sha256=QJGr2UvYJcU2Gy2w8z_cEvTodjv7hGdd2PPPfdOI-Mw,4017
20
20
  kostyl/ml/lightning/loggers/__init__.py,sha256=e51dszaoJbuzwBkbdugmuDsPldoSO4yaRgmZUg1Bdy0,71
21
21
  kostyl/ml/lightning/loggers/tb_logger.py,sha256=j02HK5ue8yzXXV8FWKmmXyHkFlIxgHx-ahHWk_rFCZs,893
22
- kostyl/ml/lightning/training_utils.py,sha256=WSOMlqfNC8IRLl2llf9vKUTJwV8qgwWaEItft68VZSM,9019
22
+ kostyl/ml/lightning/training_utils.py,sha256=u7X9ysF9Gqy8CdwacdcDlNQNsbagYAhslbv-1WLJ45k,9052
23
23
  kostyl/ml/metrics_formatting.py,sha256=U6vdNENZLvp2dT1L3HqFKtXrHwGKoDXN93hvamPGHjM,1341
24
24
  kostyl/ml/params_groups.py,sha256=nUyw5d06Pvy9QPiYtZzLYR87xwXqJLxbHthgQH8oSCM,3583
25
25
  kostyl/ml/registry_uploader.py,sha256=W90TYo_WKv2oBE6nqEJl4hecYmJyyuKwQJ9_uUPGnJQ,3346
@@ -32,6 +32,6 @@ kostyl/utils/__init__.py,sha256=hkpmB6c5pr4Ti5BshOROebb7cvjDZfNCw83qZ_FFKMM,240
32
32
  kostyl/utils/dict_manipulations.py,sha256=e3vBicID74nYP8lHkVTQc4-IQwoJimrbFELy5uSF6Gk,1073
33
33
  kostyl/utils/fs.py,sha256=gAQNIU4R_2DhwjgzOS8BOMe0gZymtY1eZwmdgOdDgqo,510
34
34
  kostyl/utils/logging.py,sha256=Vye0u4-yeOSUc-f03gpQbxSktTbFiilTWLEVr00ZHvc,5796
35
- kostyl_toolkit-0.1.32.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
36
- kostyl_toolkit-0.1.32.dist-info/METADATA,sha256=Chx6XpZE5vULjb6b9k-8R044xdsjq8lhO182Wi8PJa4,4269
37
- kostyl_toolkit-0.1.32.dist-info/RECORD,,
35
+ kostyl_toolkit-0.1.33.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
36
+ kostyl_toolkit-0.1.33.dist-info/METADATA,sha256=O-KYNVz8-H1ihBGjaqKLbaecroD3dx2guZ8hzR-M2Wg,4269
37
+ kostyl_toolkit-0.1.33.dist-info/RECORD,,