ob-metaflow-stubs 6.0.3.110__py2.py3-none-any.whl → 6.0.3.111__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. metaflow-stubs/__init__.pyi +480 -480
  2. metaflow-stubs/cards.pyi +4 -4
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +3 -3
  13. metaflow-stubs/info_file.pyi +1 -1
  14. metaflow-stubs/metadata/metadata.pyi +1 -1
  15. metaflow-stubs/metadata/util.pyi +1 -1
  16. metaflow-stubs/metaflow_config.pyi +1 -1
  17. metaflow-stubs/metaflow_current.pyi +118 -118
  18. metaflow-stubs/mflog/mflog.pyi +1 -1
  19. metaflow-stubs/multicore_utils.pyi +1 -1
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  24. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  30. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  31. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +1 -1
  36. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  37. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +1 -1
  52. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  59. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  60. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  61. metaflow-stubs/plugins/cards/card_client.pyi +1 -1
  62. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  74. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  75. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  77. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  82. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  83. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  84. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  101. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  102. metaflow-stubs/plugins/package_cli.pyi +1 -1
  103. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/perimeters.pyi +1 -1
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  112. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  118. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  120. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  121. metaflow-stubs/procpoll.pyi +1 -1
  122. metaflow-stubs/profilers/__init__.pyi +1 -1
  123. metaflow-stubs/pylint_wrapper.pyi +1 -1
  124. metaflow-stubs/runner/__init__.pyi +1 -1
  125. metaflow-stubs/runner/deployer.pyi +2 -2
  126. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  127. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  128. metaflow-stubs/runner/nbrun.pyi +1 -1
  129. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  130. metaflow-stubs/runner/utils.pyi +1 -1
  131. metaflow-stubs/system/__init__.pyi +2 -2
  132. metaflow-stubs/system/system_logger.pyi +1 -1
  133. metaflow-stubs/system/system_monitor.pyi +2 -2
  134. metaflow-stubs/tagging_util.pyi +1 -1
  135. metaflow-stubs/tuple_util.pyi +1 -1
  136. {ob_metaflow_stubs-6.0.3.110.dist-info → ob_metaflow_stubs-6.0.3.111.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.111.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.110.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.110.dist-info → ob_metaflow_stubs-6.0.3.111.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.110.dist-info → ob_metaflow_stubs-6.0.3.111.dist-info}/top_level.txt +0 -0
metaflow-stubs/cards.pyi CHANGED
@@ -1,19 +1,19 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.850658 #
4
+ # Generated on 2024-10-21T17:14:28.449301 #
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.plugins.cards.card_modules.basic
12
- import metaflow.plugins.cards.card_modules.components
13
11
  import metaflow.plugins.cards.card_client
12
+ import metaflow.plugins.cards.card_modules.components
14
13
  import metaflow.plugins.cards.card_modules.card
15
- import metaflow
16
14
  import typing
15
+ import metaflow
16
+ import metaflow.plugins.cards.card_modules.basic
17
17
 
18
18
  def get_cards(task: typing.Union[str, "metaflow.Task"], id: typing.Optional[str] = None, type: typing.Optional[str] = None, follow_resumed: bool = True) -> metaflow.plugins.cards.card_client.CardContainer:
19
19
  """
metaflow-stubs/cli.pyi CHANGED
@@ -1,15 +1,15 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.868811 #
4
+ # Generated on 2024-10-21T17:14:28.465838 #
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.exception
12
11
  import metaflow.metaflow_current
12
+ import metaflow.exception
13
13
 
14
14
  def get_metadata() -> str:
15
15
  """
@@ -1,17 +1,17 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.856829 #
4
+ # Generated on 2024-10-21T17:14:28.456087 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
13
- import metaflow.client.core
14
12
  import metaflow.events
13
+ import metaflow.client.core
14
+ import datetime
15
15
 
16
16
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
17
17
  """
@@ -1,21 +1,21 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.846575 #
4
+ # Generated on 2024-10-21T17:14:28.445808 #
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.events
11
12
  import metaflow.exception
12
- import metaflow.client.core
13
+ import typing
13
14
  import metaflow.metaflow_current
15
+ import metaflow
16
+ import metaflow.client.core
14
17
  import datetime
15
18
  import tarfile
16
- import metaflow
17
- import typing
18
- import metaflow.events
19
19
 
20
20
  current: metaflow.metaflow_current.Current
21
21
 
@@ -1,15 +1,15 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.869683 #
4
+ # Generated on 2024-10-21T17:14:28.466737 #
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.exception
12
11
  import metaflow.datastore.content_addressed_store
12
+ import metaflow.exception
13
13
 
14
14
  class MetaflowException(Exception, metaclass=type):
15
15
  def __init__(self, msg = "", lineno = None):
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.867260 #
4
+ # Generated on 2024-10-21T17:14:28.464727 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
metaflow-stubs/events.pyi CHANGED
@@ -1,15 +1,15 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.851300 #
4
+ # Generated on 2024-10-21T17:14:28.449891 #
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.events
12
+ import metaflow
13
13
 
14
14
  TYPE_CHECKING: bool
15
15
 
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.838642 #
4
+ # Generated on 2024-10-21T17:14:28.438086 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,19 +1,19 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.847965 #
4
+ # Generated on 2024-10-21T17:14:28.447298 #
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.datastore.inputs
12
- import metaflow.exception
13
11
  import metaflow.flowspec
14
12
  import metaflow.parameters
15
- import metaflow.unbounded_foreach
13
+ import metaflow.exception
14
+ import metaflow.datastore.inputs
16
15
  import typing
16
+ import metaflow.unbounded_foreach
17
17
 
18
18
  class DelayedEvaluationParameter(object, metaclass=type):
19
19
  """
@@ -1 +1 @@
1
- 2.12.25.2+obcheckpoint(0.1.0);ob(v1) 2024-10-16T01:27:45.821883
1
+ 2.12.25.2+obcheckpoint(0.1.0);ob(v1) 2024-10-21T17:14:28.423007
@@ -1,18 +1,18 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.854197 #
4
+ # Generated on 2024-10-21T17:14:28.452700 #
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.plugins.datatools.s3.s3
12
11
  import metaflow.parameters
12
+ import metaflow._vendor.click.types
13
13
  import typing
14
+ import metaflow.plugins.datatools.s3.s3
14
15
  import io
15
- import metaflow._vendor.click.types
16
16
 
17
17
  class MetaflowException(Exception, metaclass=type):
18
18
  def __init__(self, msg = "", lineno = None):
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.837852 #
4
+ # Generated on 2024-10-21T17:14:28.437405 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.893379 #
4
+ # Generated on 2024-10-21T17:14:28.491273 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.929549 #
4
+ # Generated on 2024-10-21T17:14:28.528150 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.839767 #
4
+ # Generated on 2024-10-21T17:14:28.439248 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,21 +1,21 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.942071 #
4
+ # Generated on 2024-10-21T17:14:28.545404 #
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_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator
12
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator
13
- import metaflow.plugins.cards.component_serializer
14
- import metaflow.metaflow_current
15
- import metaflow
11
+ import metaflow.events
16
12
  import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core
17
13
  import typing
18
- import metaflow.events
14
+ import metaflow.metaflow_current
15
+ import metaflow
16
+ import metaflow.plugins.cards.component_serializer
17
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator
18
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator
19
19
 
20
20
  TYPE_CHECKING: bool
21
21
 
@@ -227,97 +227,31 @@ class Current(object, metaclass=type):
227
227
  def graph(_):
228
228
  ...
229
229
  @property
230
- def huggingface_hub(self) -> "metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator.HuggingfaceRegistry":
230
+ def parallel(self) -> "metaflow.metaflow_current.Parallel":
231
231
  """
232
- (only in the presence of the @huggingface_hub decorator)
233
-
234
- The `@huggingface_hub` injects a `huggingface_hub` object into the `current` object. This object provides syntactic sugar
235
- over [huggingface_hub](https://github.com/huggingface/huggingface_hub)'s
236
- [snapshot_download](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download) function.
237
- The `current.huggingface_hub.snapshot_download` function downloads objects from huggingface hub and saves them to the Metaflow's datastore under the
238
- `<repo_type>/<repo_id>` name. The `repo_type` is by default `model` and can be overriden by passing the `repo_type` parameter to the `snapshot_download` function.
239
-
232
+ (only in the presence of the @parallel decorator)
240
233
 
241
- Usage:
242
- ------
243
- ```python
244
- @huggingface_hub
245
- @step
246
- def pull_model_from_huggingface(self):
247
- # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
248
- # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
249
- # with the same `repo_id` in the backend storage, it will not download the model again. The return
250
- # value of the function is a reference to the model in the backend storage.
251
- # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
252
234
 
253
- self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
254
- self.llama_model = current.huggingface_hub.snapshot_download(
255
- repo_id=self.model_id,
256
- allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
257
- )
258
- self.next(self.train)
259
- ```
235
+ Returns
236
+ -------
237
+ Parallel
238
+ `namedtuple` with the following fields:
239
+ - main_ip : str
240
+ The IP address of the control task.
241
+ - num_nodes : int
242
+ The total number of tasks created by @parallel
243
+ - node_index : int
244
+ The index of the current task in all the @parallel tasks.
245
+ - control_task_id : Optional[str]
246
+ The task ID of the control task. Available to all tasks.
260
247
  """
261
248
  ...
262
249
  @property
263
- def model(self) -> "metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core.ModelSerializer":
250
+ def is_parallel(self) -> bool:
264
251
  """
265
- (only in the presence of the @model decorator)
266
-
267
- The object used for loading / saving models.
268
- `current.model` exposes a `save` method to save models and a `load` method to load models.
269
- `current.model.loaded` exposes the paths to the models loaded via the `load` argument in the @model decorator
270
- or models loaded via `current.model.load`.
271
-
272
- Usage (Saving a model):
273
- -------
274
-
275
- ```
276
- @model
277
- @step
278
- def train(self):
279
- # current.model.save returns a dictionary reference to the model saved
280
- self.my_model = current.model.save(
281
- path_to_my_model,
282
- label="my_model",
283
- metadata={
284
- "epochs": 10,
285
- "batch-size": 32,
286
- "learning-rate": 0.001,
287
- }
288
- )
289
- self.next(self.test)
290
-
291
- @model(load="my_model")
292
- @step
293
- def test(self):
294
- # `current.model.loaded` returns a dictionary of the loaded models
295
- # where the key is the name of the artifact and the value is the path to the model
296
- print(os.listdir(current.model.loaded["my_model"]))
297
- self.next(self.end)
298
- ```
299
-
300
- Usage (Loading models):
301
- -------
302
-
303
- ```
304
- @step
305
- def train(self):
306
- # current.model.load returns the path to the model loaded
307
- checkpoint_path = current.model.load(
308
- self.checkpoint_key,
309
- )
310
- model_path = current.model.load(
311
- self.model,
312
- )
313
- self.next(self.test)
314
- ```
315
-
252
+ (only in the presence of the @parallel decorator)
316
253
 
317
- Returns
318
- -------
319
- ModelSerializer
320
- The object used for loading / saving models.
254
+ True if the current step is a @parallel step.
321
255
  """
322
256
  ...
323
257
  @property
@@ -382,31 +316,97 @@ class Current(object, metaclass=type):
382
316
  """
383
317
  ...
384
318
  @property
385
- def parallel(self) -> "metaflow.metaflow_current.Parallel":
319
+ def model(self) -> "metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core.ModelSerializer":
386
320
  """
387
- (only in the presence of the @parallel decorator)
321
+ (only in the presence of the @model decorator)
322
+
323
+ The object used for loading / saving models.
324
+ `current.model` exposes a `save` method to save models and a `load` method to load models.
325
+ `current.model.loaded` exposes the paths to the models loaded via the `load` argument in the @model decorator
326
+ or models loaded via `current.model.load`.
327
+
328
+ Usage (Saving a model):
329
+ -------
330
+
331
+ ```
332
+ @model
333
+ @step
334
+ def train(self):
335
+ # current.model.save returns a dictionary reference to the model saved
336
+ self.my_model = current.model.save(
337
+ path_to_my_model,
338
+ label="my_model",
339
+ metadata={
340
+ "epochs": 10,
341
+ "batch-size": 32,
342
+ "learning-rate": 0.001,
343
+ }
344
+ )
345
+ self.next(self.test)
346
+
347
+ @model(load="my_model")
348
+ @step
349
+ def test(self):
350
+ # `current.model.loaded` returns a dictionary of the loaded models
351
+ # where the key is the name of the artifact and the value is the path to the model
352
+ print(os.listdir(current.model.loaded["my_model"]))
353
+ self.next(self.end)
354
+ ```
355
+
356
+ Usage (Loading models):
357
+ -------
358
+
359
+ ```
360
+ @step
361
+ def train(self):
362
+ # current.model.load returns the path to the model loaded
363
+ checkpoint_path = current.model.load(
364
+ self.checkpoint_key,
365
+ )
366
+ model_path = current.model.load(
367
+ self.model,
368
+ )
369
+ self.next(self.test)
370
+ ```
388
371
 
389
372
 
390
373
  Returns
391
374
  -------
392
- Parallel
393
- `namedtuple` with the following fields:
394
- - main_ip : str
395
- The IP address of the control task.
396
- - num_nodes : int
397
- The total number of tasks created by @parallel
398
- - node_index : int
399
- The index of the current task in all the @parallel tasks.
400
- - control_task_id : Optional[str]
401
- The task ID of the control task. Available to all tasks.
375
+ ModelSerializer
376
+ The object used for loading / saving models.
402
377
  """
403
378
  ...
404
379
  @property
405
- def is_parallel(self) -> bool:
380
+ def huggingface_hub(self) -> "metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator.HuggingfaceRegistry":
406
381
  """
407
- (only in the presence of the @parallel decorator)
382
+ (only in the presence of the @huggingface_hub decorator)
408
383
 
409
- True if the current step is a @parallel step.
384
+ The `@huggingface_hub` injects a `huggingface_hub` object into the `current` object. This object provides syntactic sugar
385
+ over [huggingface_hub](https://github.com/huggingface/huggingface_hub)'s
386
+ [snapshot_download](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download) function.
387
+ The `current.huggingface_hub.snapshot_download` function downloads objects from huggingface hub and saves them to the Metaflow's datastore under the
388
+ `<repo_type>/<repo_id>` name. The `repo_type` is by default `model` and can be overriden by passing the `repo_type` parameter to the `snapshot_download` function.
389
+
390
+
391
+ Usage:
392
+ ------
393
+ ```python
394
+ @huggingface_hub
395
+ @step
396
+ def pull_model_from_huggingface(self):
397
+ # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
398
+ # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
399
+ # with the same `repo_id` in the backend storage, it will not download the model again. The return
400
+ # value of the function is a reference to the model in the backend storage.
401
+ # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
402
+
403
+ self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
404
+ self.llama_model = current.huggingface_hub.snapshot_download(
405
+ repo_id=self.model_id,
406
+ allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
407
+ )
408
+ self.next(self.train)
409
+ ```
410
410
  """
411
411
  ...
412
412
  @property
@@ -428,19 +428,6 @@ class Current(object, metaclass=type):
428
428
  """
429
429
  ...
430
430
  @property
431
- def trigger(self) -> "metaflow.events.Trigger":
432
- """
433
- (only in the presence of the @trigger, or @trigger_on_finish decorators)
434
-
435
- Returns `Trigger` if the current run is triggered by an event
436
-
437
- Returns
438
- -------
439
- Trigger
440
- `Trigger` if triggered by an event
441
- """
442
- ...
443
- @property
444
431
  def project_name(self) -> str:
445
432
  """
446
433
  (only in the presence of the @project decorator)
@@ -507,6 +494,19 @@ class Current(object, metaclass=type):
507
494
  True if the flow is deployed with `--production`.
508
495
  """
509
496
  ...
497
+ @property
498
+ def trigger(self) -> "metaflow.events.Trigger":
499
+ """
500
+ (only in the presence of the @trigger_on_finish, or @trigger decorators)
501
+
502
+ Returns `Trigger` if the current run is triggered by an event
503
+
504
+ Returns
505
+ -------
506
+ Trigger
507
+ `Trigger` if triggered by an event
508
+ """
509
+ ...
510
510
  ...
511
511
 
512
512
  current: Current
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.893692 #
4
+ # Generated on 2024-10-21T17:14:28.491593 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.840173 #
4
+ # Generated on 2024-10-21T17:14:28.439665 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,17 +1,17 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.841524 #
4
+ # Generated on 2024-10-21T17:14:28.440849 #
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.parameters
12
11
  import typing
13
- import metaflow.exception
14
12
  import metaflow._vendor.click.types
13
+ import metaflow.exception
14
+ import metaflow.parameters
15
15
 
16
16
  class ParameterFieldFailed(metaflow.exception.MetaflowException, metaclass=type):
17
17
  def __init__(self, name, field):
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.858448 #
4
+ # Generated on 2024-10-21T17:14:28.457818 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.887762 #
4
+ # Generated on 2024-10-21T17:14:28.485048 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.926945 #
4
+ # Generated on 2024-10-21T17:14:28.525350 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.925995 #
4
+ # Generated on 2024-10-21T17:14:28.524395 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.927287 #
4
+ # Generated on 2024-10-21T17:14:28.525639 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,15 +1,15 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-16T01:27:45.940016 #
4
+ # Generated on 2024-10-21T17:14:28.542649 #
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.decorators
12
11
  import metaflow.exception
12
+ import metaflow.decorators
13
13
 
14
14
  class AirflowException(metaflow.exception.MetaflowException, metaclass=type):
15
15
  def __init__(self, msg):