ob-metaflow-stubs 6.0.3.125__py2.py3-none-any.whl → 6.0.3.126__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +289 -285
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +9 -21
- metaflow-stubs/{plugins/package_cli.pyi → cli_components/__init__.pyi} +3 -3
- metaflow-stubs/cli_components/utils.pyi +35 -0
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +12 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +20 -13
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -2
- metaflow-stubs/metaflow_current.pyi +131 -131
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +5 -5
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +35 -18
- metaflow-stubs/plugins/__init__.pyi +14 -14
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -5
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +31 -3
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -3
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +3 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +5 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -3
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -5
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +6 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +4 -4
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +30 -30
- metaflow-stubs/runner/deployer_impl.pyi +4 -4
- metaflow-stubs/runner/metaflow_runner.pyi +5 -5
- metaflow-stubs/runner/nbdeploy.pyi +4 -2
- metaflow-stubs/runner/nbrun.pyi +3 -3
- metaflow-stubs/runner/subprocess_manager.pyi +5 -2
- metaflow-stubs/runner/utils.pyi +7 -7
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/{plugins/aws/step_functions/production_token.pyi → user_configs/__init__.pyi} +5 -11
- metaflow-stubs/user_configs/config_decorators.pyi +253 -0
- metaflow-stubs/user_configs/config_options.pyi +82 -0
- metaflow-stubs/user_configs/config_parameters.pyi +217 -0
- {ob_metaflow_stubs-6.0.3.125.dist-info → ob_metaflow_stubs-6.0.3.126.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.126.dist-info/RECORD +173 -0
- metaflow-stubs/clone_util.pyi +0 -14
- metaflow-stubs/mflog/__init__.pyi +0 -6
- metaflow-stubs/mflog/mflog.pyi +0 -69
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +0 -103
- metaflow-stubs/plugins/cards/card_cli.pyi +0 -146
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +0 -33
- metaflow-stubs/plugins/logs_cli.pyi +0 -46
- metaflow-stubs/plugins/tag_cli.pyi +0 -19
- metaflow-stubs/procpoll.pyi +0 -53
- ob_metaflow_stubs-6.0.3.125.dist-info/RECORD +0 -178
- {ob_metaflow_stubs-6.0.3.125.dist-info → ob_metaflow_stubs-6.0.3.126.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.125.dist-info → ob_metaflow_stubs-6.0.3.126.dist-info}/top_level.txt +0 -0
@@ -1,20 +1,20 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.901107 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator
|
12
11
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator
|
13
|
-
import metaflow
|
14
|
-
import typing
|
15
12
|
import metaflow.events
|
13
|
+
import metaflow
|
16
14
|
import metaflow.metaflow_current
|
17
15
|
import metaflow.plugins.cards.component_serializer
|
16
|
+
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator
|
17
|
+
import typing
|
18
18
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core
|
19
19
|
|
20
20
|
|
@@ -228,85 +228,6 @@ class Current(object, metaclass=type):
|
|
228
228
|
def graph(self):
|
229
229
|
...
|
230
230
|
@property
|
231
|
-
def model(self) -> "metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core.ModelSerializer":
|
232
|
-
"""
|
233
|
-
(only in the presence of the @model decorator)
|
234
|
-
|
235
|
-
The object used for loading / saving models.
|
236
|
-
`current.model` exposes a `save` method to save models and a `load` method to load models.
|
237
|
-
`current.model.loaded` exposes the paths to the models loaded via the `load` argument in the @model decorator
|
238
|
-
or models loaded via `current.model.load`.
|
239
|
-
|
240
|
-
Usage (Saving a model):
|
241
|
-
-------
|
242
|
-
|
243
|
-
```
|
244
|
-
@model
|
245
|
-
@step
|
246
|
-
def train(self):
|
247
|
-
# current.model.save returns a dictionary reference to the model saved
|
248
|
-
self.my_model = current.model.save(
|
249
|
-
path_to_my_model,
|
250
|
-
label="my_model",
|
251
|
-
metadata={
|
252
|
-
"epochs": 10,
|
253
|
-
"batch-size": 32,
|
254
|
-
"learning-rate": 0.001,
|
255
|
-
}
|
256
|
-
)
|
257
|
-
self.next(self.test)
|
258
|
-
|
259
|
-
@model(load="my_model")
|
260
|
-
@step
|
261
|
-
def test(self):
|
262
|
-
# `current.model.loaded` returns a dictionary of the loaded models
|
263
|
-
# where the key is the name of the artifact and the value is the path to the model
|
264
|
-
print(os.listdir(current.model.loaded["my_model"]))
|
265
|
-
self.next(self.end)
|
266
|
-
```
|
267
|
-
|
268
|
-
Usage (Loading models):
|
269
|
-
-------
|
270
|
-
|
271
|
-
```
|
272
|
-
@step
|
273
|
-
def train(self):
|
274
|
-
# current.model.load returns the path to the model loaded
|
275
|
-
checkpoint_path = current.model.load(
|
276
|
-
self.checkpoint_key,
|
277
|
-
)
|
278
|
-
model_path = current.model.load(
|
279
|
-
self.model,
|
280
|
-
)
|
281
|
-
self.next(self.test)
|
282
|
-
```
|
283
|
-
|
284
|
-
|
285
|
-
Returns
|
286
|
-
-------
|
287
|
-
ModelSerializer
|
288
|
-
The object used for loading / saving models.
|
289
|
-
"""
|
290
|
-
...
|
291
|
-
@property
|
292
|
-
def card(self) -> "metaflow.plugins.cards.component_serializer.CardComponentCollector":
|
293
|
-
"""
|
294
|
-
(only in the presence of the @card decorator)
|
295
|
-
|
296
|
-
The `@card` decorator makes the cards available through the `current.card`
|
297
|
-
object. If multiple `@card` decorators are present, you can add an `ID` to
|
298
|
-
distinguish between them using `@card(id=ID)` as the decorator. You will then
|
299
|
-
be able to access that specific card using `current.card[ID].
|
300
|
-
|
301
|
-
Methods available are `append` and `extend`
|
302
|
-
|
303
|
-
Returns
|
304
|
-
-------
|
305
|
-
CardComponentCollector
|
306
|
-
The or one of the cards attached to this step.
|
307
|
-
"""
|
308
|
-
...
|
309
|
-
@property
|
310
231
|
def parallel(self) -> "metaflow.metaflow_current.Parallel":
|
311
232
|
"""
|
312
233
|
(only in the presence of the @parallel decorator)
|
@@ -336,6 +257,67 @@ class Current(object, metaclass=type):
|
|
336
257
|
"""
|
337
258
|
...
|
338
259
|
@property
|
260
|
+
def checkpoint(self) -> "metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator.CurrentCheckpointer":
|
261
|
+
"""
|
262
|
+
(only in the presence of the @checkpoint decorator)
|
263
|
+
|
264
|
+
The `@checkpoint` decorator makes saving/loading checkpoints available through the `current.checkpoint`.
|
265
|
+
The object exposes `save`/`load`/`list` methods for saving/loading checkpoints.
|
266
|
+
|
267
|
+
You can check if a checkpoint is loaded by `current.checkpoint.is_loaded` and get the checkpoint information
|
268
|
+
by using `current.checkpoint.info`. The `current.checkpoint.directory` returns the path to the checkpoint directory
|
269
|
+
where the checkpoint maybe loaded or saved.
|
270
|
+
|
271
|
+
Usage (Saving Checkpoints):
|
272
|
+
-------
|
273
|
+
```
|
274
|
+
@checkpoint
|
275
|
+
@step
|
276
|
+
def train(self):
|
277
|
+
model = create_model(self.parameters, checkpoint_path = None)
|
278
|
+
for i in range(self.epochs):
|
279
|
+
# some training logic
|
280
|
+
loss = model.train(self.dataset)
|
281
|
+
if i % 10 == 0:
|
282
|
+
model.save(
|
283
|
+
current.checkpoint.directory,
|
284
|
+
)
|
285
|
+
# saves the contents of the `current.checkpoint.directory` as a checkpoint
|
286
|
+
# and returns a reference dictionary to the checkpoint saved in the datastore
|
287
|
+
self.latest_checkpoint = current.checkpoint.save(
|
288
|
+
name="epoch_checkpoint",
|
289
|
+
metadata={
|
290
|
+
"epoch": i,
|
291
|
+
"loss": loss,
|
292
|
+
}
|
293
|
+
)
|
294
|
+
```
|
295
|
+
Usage (Using Loaded Checkpoints):
|
296
|
+
-------
|
297
|
+
```
|
298
|
+
@retry(times=3)
|
299
|
+
@checkpoint
|
300
|
+
@step
|
301
|
+
def train(self):
|
302
|
+
# Assume that the task has restarted and the previous attempt of the task
|
303
|
+
# saved a checkpoint
|
304
|
+
checkpoint_path = None
|
305
|
+
if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
|
306
|
+
print("Loaded checkpoint from the previous attempt")
|
307
|
+
checkpoint_path = current.checkpoint.directory
|
308
|
+
|
309
|
+
model = create_model(self.parameters, checkpoint_path = checkpoint_path)
|
310
|
+
for i in range(self.epochs):
|
311
|
+
...
|
312
|
+
```
|
313
|
+
|
314
|
+
Returns
|
315
|
+
-------
|
316
|
+
CurrentCheckpointer
|
317
|
+
The object for handling checkpointing within a step.
|
318
|
+
"""
|
319
|
+
...
|
320
|
+
@property
|
339
321
|
def huggingface_hub(self) -> "metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator.HuggingfaceRegistry":
|
340
322
|
"""
|
341
323
|
(only in the presence of the @huggingface_hub decorator)
|
@@ -405,77 +387,82 @@ class Current(object, metaclass=type):
|
|
405
387
|
"""
|
406
388
|
...
|
407
389
|
@property
|
408
|
-
def
|
390
|
+
def model(self) -> "metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core.ModelSerializer":
|
409
391
|
"""
|
410
|
-
(only in the presence of the @
|
411
|
-
|
412
|
-
The `@checkpoint` decorator makes saving/loading checkpoints available through the `current.checkpoint`.
|
413
|
-
The object exposes `save`/`load`/`list` methods for saving/loading checkpoints.
|
392
|
+
(only in the presence of the @model decorator)
|
414
393
|
|
415
|
-
|
416
|
-
|
417
|
-
|
394
|
+
The object used for loading / saving models.
|
395
|
+
`current.model` exposes a `save` method to save models and a `load` method to load models.
|
396
|
+
`current.model.loaded` exposes the paths to the models loaded via the `load` argument in the @model decorator
|
397
|
+
or models loaded via `current.model.load`.
|
418
398
|
|
419
|
-
Usage (Saving
|
399
|
+
Usage (Saving a model):
|
420
400
|
-------
|
401
|
+
|
421
402
|
```
|
422
|
-
@
|
403
|
+
@model
|
423
404
|
@step
|
424
405
|
def train(self):
|
425
|
-
model
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
406
|
+
# current.model.save returns a dictionary reference to the model saved
|
407
|
+
self.my_model = current.model.save(
|
408
|
+
path_to_my_model,
|
409
|
+
label="my_model",
|
410
|
+
metadata={
|
411
|
+
"epochs": 10,
|
412
|
+
"batch-size": 32,
|
413
|
+
"learning-rate": 0.001,
|
414
|
+
}
|
415
|
+
)
|
416
|
+
self.next(self.test)
|
417
|
+
|
418
|
+
@model(load="my_model")
|
419
|
+
@step
|
420
|
+
def test(self):
|
421
|
+
# `current.model.loaded` returns a dictionary of the loaded models
|
422
|
+
# where the key is the name of the artifact and the value is the path to the model
|
423
|
+
print(os.listdir(current.model.loaded["my_model"]))
|
424
|
+
self.next(self.end)
|
442
425
|
```
|
443
|
-
|
426
|
+
|
427
|
+
Usage (Loading models):
|
444
428
|
-------
|
429
|
+
|
445
430
|
```
|
446
|
-
@retry(times=3)
|
447
|
-
@checkpoint
|
448
431
|
@step
|
449
432
|
def train(self):
|
450
|
-
#
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
for i in range(self.epochs):
|
459
|
-
...
|
433
|
+
# current.model.load returns the path to the model loaded
|
434
|
+
checkpoint_path = current.model.load(
|
435
|
+
self.checkpoint_key,
|
436
|
+
)
|
437
|
+
model_path = current.model.load(
|
438
|
+
self.model,
|
439
|
+
)
|
440
|
+
self.next(self.test)
|
460
441
|
```
|
461
442
|
|
443
|
+
|
462
444
|
Returns
|
463
445
|
-------
|
464
|
-
|
465
|
-
The object for
|
446
|
+
ModelSerializer
|
447
|
+
The object used for loading / saving models.
|
466
448
|
"""
|
467
449
|
...
|
468
450
|
@property
|
469
|
-
def
|
451
|
+
def card(self) -> "metaflow.plugins.cards.component_serializer.CardComponentCollector":
|
470
452
|
"""
|
471
|
-
(only in the presence of the @
|
453
|
+
(only in the presence of the @card decorator)
|
472
454
|
|
473
|
-
|
455
|
+
The `@card` decorator makes the cards available through the `current.card`
|
456
|
+
object. If multiple `@card` decorators are present, you can add an `ID` to
|
457
|
+
distinguish between them using `@card(id=ID)` as the decorator. You will then
|
458
|
+
be able to access that specific card using `current.card[ID].
|
459
|
+
|
460
|
+
Methods available are `append` and `extend`
|
474
461
|
|
475
462
|
Returns
|
476
463
|
-------
|
477
|
-
|
478
|
-
|
464
|
+
CardComponentCollector
|
465
|
+
The or one of the cards attached to this step.
|
479
466
|
"""
|
480
467
|
...
|
481
468
|
@property
|
@@ -545,6 +532,19 @@ class Current(object, metaclass=type):
|
|
545
532
|
True if the flow is deployed with `--production`.
|
546
533
|
"""
|
547
534
|
...
|
535
|
+
@property
|
536
|
+
def trigger(self) -> "metaflow.events.Trigger":
|
537
|
+
"""
|
538
|
+
(only in the presence of the @trigger_on_finish, or @trigger decorators)
|
539
|
+
|
540
|
+
Returns `Trigger` if the current run is triggered by an event
|
541
|
+
|
542
|
+
Returns
|
543
|
+
-------
|
544
|
+
Trigger
|
545
|
+
`Trigger` if triggered by an event
|
546
|
+
"""
|
547
|
+
...
|
548
548
|
...
|
549
549
|
|
550
550
|
current: Current
|
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.771989 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.780600 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.780664 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.780723 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.780781 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.865060 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -11,8 +11,8 @@ import typing
|
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
import metaflow.datastore.datastore_storage
|
13
13
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core
|
14
|
-
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
15
14
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.checkpoint_storage
|
15
|
+
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
16
16
|
|
17
17
|
from ..exceptions import KeyNotCompatibleWithObjectException as KeyNotCompatibleWithObjectException
|
18
18
|
from ..utils.identity_utils import pathspec_hash as pathspec_hash
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.803612 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.826477 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.core
|
12
|
-
import metaflow
|
13
|
-
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
14
11
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.checkpoint_storage
|
12
|
+
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
13
|
+
import metaflow
|
14
|
+
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.core
|
15
15
|
|
16
16
|
from ......metaflow_current import current as current
|
17
17
|
from ......exception import MetaflowException as MetaflowException
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.803826 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.780827 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow
|
12
11
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
12
|
+
import metaflow
|
13
13
|
|
14
14
|
from ..datastructures import CheckpointArtifact as CheckpointArtifact
|
15
15
|
from .constructors import load_checkpoint as load_checkpoint
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.804429 #
|
5
5
|
######################################################################################################
|
6
6
|
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.827688 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core
|
12
11
|
import metaflow.datastore.datastore_storage
|
12
|
+
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core
|
13
13
|
|
14
14
|
from ......exception import MetaflowException as MetaflowException
|
15
15
|
from ..utils.tar_utils import create_tarball_on_disk as create_tarball_on_disk
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.880630 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,13 +1,13 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.804479 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
|
-
import metaflow
|
10
9
|
import typing
|
10
|
+
import metaflow
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
import metaflow.exception
|
13
13
|
import metaflow
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.880816 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.781899 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
|
-
import metaflow
|
10
9
|
import typing
|
10
|
+
import metaflow
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
13
13
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.804146 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.863855 #
|
5
5
|
######################################################################################################
|
6
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.863908 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.865939 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.880354 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-12-17T01:10:55.865543 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
|
-
import metaflow
|
10
9
|
import typing
|
10
|
+
import metaflow
|
11
11
|
if typing.TYPE_CHECKING:
|
12
12
|
import metaflow.exception
|
13
13
|
|