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.
Files changed (182) hide show
  1. metaflow-stubs/__init__.pyi +289 -285
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +9 -21
  4. metaflow-stubs/{plugins/package_cli.pyi → cli_components/__init__.pyi} +3 -3
  5. metaflow-stubs/cli_components/utils.pyi +35 -0
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +5 -5
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +12 -5
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +20 -13
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +4 -2
  20. metaflow-stubs/metaflow_current.pyi +131 -131
  21. metaflow-stubs/mf_extensions/__init__.pyi +2 -2
  22. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
  23. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +5 -5
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
  43. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  44. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  45. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  46. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  47. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  48. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  49. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  50. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  51. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  52. metaflow-stubs/multicore_utils.pyi +2 -2
  53. metaflow-stubs/parameters.pyi +35 -18
  54. metaflow-stubs/plugins/__init__.pyi +14 -14
  55. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  56. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  57. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  58. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  60. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  61. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  62. metaflow-stubs/plugins/argo/__init__.pyi +2 -5
  63. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  64. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  65. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -2
  66. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  67. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  68. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +31 -3
  69. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  71. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  72. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  74. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  75. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  76. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  77. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  78. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -3
  79. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  80. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  81. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +3 -2
  82. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  83. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +5 -5
  84. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  85. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  86. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  87. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  88. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  89. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  90. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  91. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  92. metaflow-stubs/plugins/cards/__init__.pyi +2 -3
  93. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  94. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  95. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  96. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  99. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  100. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  101. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  102. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  103. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  104. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  105. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  106. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  107. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  108. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  110. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  111. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  112. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  113. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  114. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  115. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  116. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  119. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  120. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  121. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  122. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  123. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  124. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  125. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  126. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -5
  127. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  128. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  129. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  130. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  131. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  132. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  133. metaflow-stubs/plugins/perimeters.pyi +2 -2
  134. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  135. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  136. metaflow-stubs/plugins/pypi/conda_decorator.pyi +6 -2
  137. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  138. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  139. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  140. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  141. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  142. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  143. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  144. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
  145. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  146. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  147. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  148. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  149. metaflow-stubs/plugins/timeout_decorator.pyi +4 -4
  150. metaflow-stubs/profilers/__init__.pyi +2 -2
  151. metaflow-stubs/pylint_wrapper.pyi +2 -2
  152. metaflow-stubs/runner/__init__.pyi +2 -2
  153. metaflow-stubs/runner/deployer.pyi +30 -30
  154. metaflow-stubs/runner/deployer_impl.pyi +4 -4
  155. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  156. metaflow-stubs/runner/nbdeploy.pyi +4 -2
  157. metaflow-stubs/runner/nbrun.pyi +3 -3
  158. metaflow-stubs/runner/subprocess_manager.pyi +5 -2
  159. metaflow-stubs/runner/utils.pyi +7 -7
  160. metaflow-stubs/system/__init__.pyi +2 -2
  161. metaflow-stubs/system/system_logger.pyi +3 -3
  162. metaflow-stubs/system/system_monitor.pyi +2 -2
  163. metaflow-stubs/tagging_util.pyi +2 -2
  164. metaflow-stubs/tuple_util.pyi +2 -2
  165. metaflow-stubs/{plugins/aws/step_functions/production_token.pyi → user_configs/__init__.pyi} +5 -11
  166. metaflow-stubs/user_configs/config_decorators.pyi +253 -0
  167. metaflow-stubs/user_configs/config_options.pyi +82 -0
  168. metaflow-stubs/user_configs/config_parameters.pyi +217 -0
  169. {ob_metaflow_stubs-6.0.3.125.dist-info → ob_metaflow_stubs-6.0.3.126.dist-info}/METADATA +1 -1
  170. ob_metaflow_stubs-6.0.3.126.dist-info/RECORD +173 -0
  171. metaflow-stubs/clone_util.pyi +0 -14
  172. metaflow-stubs/mflog/__init__.pyi +0 -6
  173. metaflow-stubs/mflog/mflog.pyi +0 -69
  174. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +0 -103
  175. metaflow-stubs/plugins/cards/card_cli.pyi +0 -146
  176. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +0 -33
  177. metaflow-stubs/plugins/logs_cli.pyi +0 -46
  178. metaflow-stubs/plugins/tag_cli.pyi +0 -19
  179. metaflow-stubs/procpoll.pyi +0 -53
  180. ob_metaflow_stubs-6.0.3.125.dist-info/RECORD +0 -178
  181. {ob_metaflow_stubs-6.0.3.125.dist-info → ob_metaflow_stubs-6.0.3.126.dist-info}/WHEEL +0 -0
  182. {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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.197914 #
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 checkpoint(self) -> "metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator.CurrentCheckpointer":
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 @checkpoint decorator)
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
- You can check if a checkpoint is loaded by `current.checkpoint.is_loaded` and get the checkpoint information
416
- by using `current.checkpoint.info`. The `current.checkpoint.directory` returns the path to the checkpoint directory
417
- where the checkpoint maybe loaded or saved.
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 Checkpoints):
399
+ Usage (Saving a model):
420
400
  -------
401
+
421
402
  ```
422
- @checkpoint
403
+ @model
423
404
  @step
424
405
  def train(self):
425
- model = create_model(self.parameters, checkpoint_path = None)
426
- for i in range(self.epochs):
427
- # some training logic
428
- loss = model.train(self.dataset)
429
- if i % 10 == 0:
430
- model.save(
431
- current.checkpoint.directory,
432
- )
433
- # saves the contents of the `current.checkpoint.directory` as a checkpoint
434
- # and returns a reference dictionary to the checkpoint saved in the datastore
435
- self.latest_checkpoint = current.checkpoint.save(
436
- name="epoch_checkpoint",
437
- metadata={
438
- "epoch": i,
439
- "loss": loss,
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
- Usage (Using Loaded Checkpoints):
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
- # Assume that the task has restarted and the previous attempt of the task
451
- # saved a checkpoint
452
- checkpoint_path = None
453
- if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
454
- print("Loaded checkpoint from the previous attempt")
455
- checkpoint_path = current.checkpoint.directory
456
-
457
- model = create_model(self.parameters, checkpoint_path = checkpoint_path)
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
- CurrentCheckpointer
465
- The object for handling checkpointing within a step.
446
+ ModelSerializer
447
+ The object used for loading / saving models.
466
448
  """
467
449
  ...
468
450
  @property
469
- def trigger(self) -> "metaflow.events.Trigger":
451
+ def card(self) -> "metaflow.plugins.cards.component_serializer.CardComponentCollector":
470
452
  """
471
- (only in the presence of the @trigger, or @trigger_on_finish decorators)
453
+ (only in the presence of the @card decorator)
472
454
 
473
- Returns `Trigger` if the current run is triggered by an event
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
- Trigger
478
- `Trigger` if triggered by an event
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.098863 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.107751 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.107840 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.107934 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.108023 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.174721 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.132772 #
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
@@ -1,17 +1,17 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.164021 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.132990 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.108101 #
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
@@ -1,6 +1,6 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.133601 #
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
 
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.165227 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.185709 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.133656 #
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
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.185901 #
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
@@ -1,13 +1,13 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.109531 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.133313 #
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
@@ -1,6 +1,6 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.173610 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.173666 #
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
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.175565 #
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.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.185439 #
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
@@ -1,13 +1,13 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.36.3+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-10T22:06:22.175161 #
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