kostyl-toolkit 0.1.32__tar.gz → 0.1.33__tar.gz
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.
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/PKG-INFO +1 -1
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/callbacks/checkpoint.py +6 -6
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/training_utils.py +4 -4
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/pyproject.toml +1 -1
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/README.md +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/clearml/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/clearml/dataset_utils.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/clearml/logging_utils.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/clearml/pulling_utils.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/configs/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/configs/base_model.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/configs/hyperparams.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/configs/training_settings.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/data_processing_utils.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/dist_utils.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/callbacks/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/callbacks/early_stopping.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/extensions/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/extensions/custom_module.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/extensions/pretrained_model.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/loggers/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/loggers/tb_logger.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/metrics_formatting.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/params_groups.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/registry_uploader.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/schedulers/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/schedulers/base.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/schedulers/composite.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/schedulers/cosine.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/schedulers/linear.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/utils/__init__.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/utils/dict_manipulations.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/utils/fs.py +0 -0
- {kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/utils/logging.py +0 -0
|
@@ -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
|
-
|
|
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
|
|
320
|
-
|
|
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) != (
|
|
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 (
|
|
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=
|
|
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
|
-
|
|
101
|
+
early_stopping_cfg: EarlyStoppingConfig | None,
|
|
102
102
|
output_model: OutputModel,
|
|
103
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/callbacks/early_stopping.py
RENAMED
|
File without changes
|
|
File without changes
|
{kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/extensions/custom_module.py
RENAMED
|
File without changes
|
{kostyl_toolkit-0.1.32 → kostyl_toolkit-0.1.33}/kostyl/ml/lightning/extensions/pretrained_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|