ob-metaflow-stubs 6.0.3.127__py2.py3-none-any.whl → 6.0.3.129__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. metaflow-stubs/__init__.pyi +228 -227
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  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 +3 -3
  11. metaflow-stubs/flowspec.pyi +6 -6
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  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 +121 -121
  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/card_utils/__init__.pyi +6 -0
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +58 -0
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +23 -0
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +69 -0
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +6 -0
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +76 -0
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +33 -0
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +249 -0
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +27 -0
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +2 -2
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +6 -0
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +206 -0
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +6 -0
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +99 -0
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +25 -0
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +80 -0
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +6 -0
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +20 -0
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +25 -0
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
  61. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
  62. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
  63. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
  64. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
  65. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
  66. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
  67. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
  68. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
  69. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
  70. metaflow-stubs/multicore_utils.pyi +2 -2
  71. metaflow-stubs/parameters.pyi +4 -4
  72. metaflow-stubs/plugins/__init__.pyi +10 -10
  73. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  74. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  75. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  76. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  77. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  78. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  79. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  80. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  82. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  83. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  84. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  85. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  86. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  87. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  89. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  90. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  92. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  93. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  94. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  95. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +15 -13
  96. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  97. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  98. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  99. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  100. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  101. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  102. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
  103. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  105. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  106. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  107. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  108. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  109. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  110. metaflow-stubs/plugins/cards/__init__.pyi +6 -6
  111. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  112. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  113. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  114. metaflow-stubs/plugins/cards/card_decorator.pyi +4 -2
  115. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  116. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  117. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  118. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  119. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  120. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  121. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  122. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  123. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  124. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  125. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  127. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  128. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  129. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  130. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  131. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  132. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  133. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  134. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  135. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  136. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  138. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  139. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  140. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  141. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  142. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  143. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  144. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  145. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  146. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  147. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  148. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  149. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  150. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  151. metaflow-stubs/plugins/perimeters.pyi +2 -2
  152. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  153. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  154. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  155. metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
  156. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  157. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  158. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  159. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  160. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  161. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  162. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  163. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  164. metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
  165. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  166. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  167. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  168. metaflow-stubs/profilers/__init__.pyi +2 -2
  169. metaflow-stubs/pylint_wrapper.pyi +2 -2
  170. metaflow-stubs/runner/__init__.pyi +2 -2
  171. metaflow-stubs/runner/deployer.pyi +29 -29
  172. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  173. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  174. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  175. metaflow-stubs/runner/nbrun.pyi +2 -2
  176. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  177. metaflow-stubs/runner/utils.pyi +2 -2
  178. metaflow-stubs/system/__init__.pyi +2 -2
  179. metaflow-stubs/system/system_logger.pyi +2 -2
  180. metaflow-stubs/system/system_monitor.pyi +2 -2
  181. metaflow-stubs/tagging_util.pyi +2 -2
  182. metaflow-stubs/tuple_util.pyi +2 -2
  183. metaflow-stubs/user_configs/__init__.pyi +2 -2
  184. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  185. metaflow-stubs/user_configs/config_options.pyi +8 -3
  186. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  187. {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.129.dist-info}/METADATA +1 -1
  188. ob_metaflow_stubs-6.0.3.129.dist-info/RECORD +191 -0
  189. ob_metaflow_stubs-6.0.3.127.dist-info/RECORD +0 -173
  190. {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.129.dist-info}/WHEEL +0 -0
  191. {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.129.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,27 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.712214 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
12
+
13
+ from ......metadata_provider.metadata import MetaDatum as MetaDatum
14
+ from ..datastructures import CheckpointArtifact as CheckpointArtifact
15
+ from .core import CheckpointReferenceResolver as CheckpointReferenceResolver
16
+
17
+ TYPE_CHECKING: bool
18
+
19
+ def checkpoint_load_related_metadata(checkpoint: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures.CheckpointArtifact, current_attempt):
20
+ ...
21
+
22
+ def trace_lineage(flow, checkpoint: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures.CheckpointArtifact):
23
+ """
24
+ Trace the lineage of the checkpoint by tracing the previous paths.
25
+ """
26
+ ...
27
+
@@ -1,6 +1,6 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:50.951215 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.682137 #
5
5
  ######################################################################################################
6
6
 
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:50.975275 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.709132 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.030083 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.766859 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:50.951266 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.682188 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.030276 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.713422 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:50.928096 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.657838 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:50.950929 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.681847 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -0,0 +1,6 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.684253 #
5
+ ######################################################################################################
6
+
@@ -0,0 +1,206 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.684308 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import metaflow
10
+ import typing
11
+ if typing.TYPE_CHECKING:
12
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator
13
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator
14
+
15
+ from ..checkpoints.decorator import CheckpointDecorator as CheckpointDecorator
16
+ from ..checkpoints.decorator import CurrentCheckpointer as CurrentCheckpointer
17
+ from ..checkpoints.decorator import warning_message as warning_message
18
+ from ......metadata_provider.metadata import MetaDatum as MetaDatum
19
+
20
+ HUGGINGFACE_HUB_ROOT_PREFIX: str
21
+
22
+ def get_tqdm_class():
23
+ ...
24
+
25
+ def show_progress():
26
+ ...
27
+
28
+ def download_model_from_huggingface(**kwargs):
29
+ ...
30
+
31
+ class HuggingfaceRegistry(object, metaclass=type):
32
+ """
33
+ This object provides syntactic sugar
34
+ over [huggingface_hub](https://github.com/huggingface/huggingface_hub)'s
35
+ [snapshot_download](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download) function.
36
+ The `current.huggingface_hub.snapshot_download` function downloads objects from huggingface hub and saves them to the Metaflow's datastore under the
37
+ `<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.
38
+ """
39
+ def __init__(self, logger):
40
+ ...
41
+ @property
42
+ def loaded(self):
43
+ ...
44
+ def snapshot_download(self, **kwargs) -> dict:
45
+ """
46
+ Downloads a model from huggingface hub and cache's it to the Metaflow's datastore.
47
+ It passes down all the parameters to the `huggingface_hub.snapshot_download` function.
48
+
49
+ Returns
50
+ -------
51
+ dict
52
+ A reference to the artifact that was saved/retrieved from the Metaflow's datastore.
53
+ """
54
+ ...
55
+ ...
56
+
57
+ class HuggingfaceLoadedModels(object, metaclass=type):
58
+ """
59
+ Manages loaded Hugging Face models and provides access to their local paths.
60
+
61
+ This class is accessed through `current.huggingface_hub.loaded` and provides a dictionary-like
62
+ interface to access the local paths of the huggingface repos specified in the `load` argument of the `@huggingface_hub` decorator.
63
+
64
+ Usage:
65
+ ------
66
+ ```python
67
+ # Basic loading and access
68
+ @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
69
+ @step
70
+ def my_step(self):
71
+ # Access the local path of a loaded model
72
+ model_path = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
73
+
74
+ # Check if a model is loaded
75
+ if "mistralai/Mistral-7B-Instruct-v0.1" in current.huggingface_hub.loaded:
76
+ print("Model is loaded!")
77
+
78
+ # Custom path and advanced loading
79
+ @huggingface_hub(load=[
80
+ ("mistralai/Mistral-7B-Instruct-v0.1", "/custom/path"), # Specify custom path
81
+ {
82
+ "repo_id": "org/model-name",
83
+ "force_download": True, # Force fresh download
84
+ "repo_type": "dataset" # Load dataset instead of model
85
+ }
86
+ ])
87
+ @step
88
+ def another_step(self):
89
+ # Models are available at specified paths
90
+ pass
91
+ ```
92
+ """
93
+ def __init__(self, checkpointer: HuggingfaceRegistry, logger, temp_dir_root = None):
94
+ ...
95
+ def __getitem__(self, key):
96
+ ...
97
+ def __contains__(self, key):
98
+ ...
99
+ @property
100
+ def info(self):
101
+ ...
102
+ def cleanup(self):
103
+ ...
104
+ ...
105
+
106
+ class HuggingfaceHubDecorator(metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.checkpoints.decorator.CheckpointDecorator, metaclass=type):
107
+ """
108
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
109
+
110
+ Parameters
111
+ ----------
112
+ temp_dir_root : str, optional
113
+ The root directory that will hold the temporary directory where objects will be downloaded.
114
+
115
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
116
+ The list of repos (models/datasets) to load.
117
+
118
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
119
+
120
+ - If repo (model/dataset) is not found in the datastore:
121
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
122
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
123
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
124
+
125
+ - If repo is found in the datastore:
126
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
127
+
128
+
129
+ MF Add To Current
130
+ -----------------
131
+ huggingface_hub -> metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.hf_hub.decorator.HuggingfaceRegistry
132
+ The `@huggingface_hub` injects a `huggingface_hub` object into the `current` object. This object provides syntactic sugar
133
+ over [huggingface_hub](https://github.com/huggingface/huggingface_hub)'s
134
+ [snapshot_download](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download) function.
135
+ The `current.huggingface_hub.snapshot_download` function downloads objects from huggingface hub and saves them to the Metaflow's datastore under the
136
+ `<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.
137
+
138
+
139
+ Usage:
140
+ ------
141
+
142
+ **Usage: creating references of models from huggingface that may be loaded in downstream steps**
143
+ ```python
144
+ @huggingface_hub
145
+ @step
146
+ def pull_model_from_huggingface(self):
147
+ # `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
148
+ # and saves it in the backend storage based on the model's `repo_id`. If there exists a model
149
+ # with the same `repo_id` in the backend storage, it will not download the model again. The return
150
+ # value of the function is a reference to the model in the backend storage.
151
+ # This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
152
+
153
+ self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
154
+ self.llama_model = current.huggingface_hub.snapshot_download(
155
+ repo_id=self.model_id,
156
+ allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
157
+ )
158
+ self.next(self.train)
159
+ ```
160
+
161
+ **Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
162
+ ```python
163
+ @huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
164
+ @step
165
+ def pull_model_from_huggingface(self):
166
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
167
+ ```
168
+
169
+ ```python
170
+ @huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
171
+ @step
172
+ def finetune_model(self):
173
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
174
+ # path_to_model will be /my-directory
175
+ ```
176
+
177
+ ```python
178
+ # Takes all the arguments passed to `snapshot_download`
179
+ # except for `local_dir`
180
+ @huggingface_hub(load=[
181
+ {
182
+ "repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
183
+ },
184
+ {
185
+ "repo_id": "myorg/mistral-lora",
186
+ "repo_type": "model",
187
+ },
188
+ ])
189
+ @step
190
+ def finetune_model(self):
191
+ path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
192
+ # path_to_model will be /my-directory
193
+ ```
194
+ """
195
+ def step_init(self, flow, graph, step_name, decorators, environment, flow_datastore, logger):
196
+ ...
197
+ def task_pre_step(self, step_name, task_datastore, metadata, run_id, task_id, flow, graph, retry_count, max_user_code_retries, ubf_context, inputs):
198
+ ...
199
+ def task_decorate(self, step_func, flow, graph, retry_count, max_user_code_retries, ubf_context):
200
+ ...
201
+ def task_post_step(self, step_name, flow, graph, retry_count, max_user_code_retries):
202
+ ...
203
+ def task_exception(self, exception, step_name, flow, graph, retry_count, max_user_code_retries):
204
+ ...
205
+ ...
206
+
@@ -0,0 +1,6 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.685215 #
5
+ ######################################################################################################
6
+
@@ -0,0 +1,99 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.685267 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.core
12
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.model_storage
13
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
14
+
15
+ from ..datastore.core import STORAGE_FORMATS as STORAGE_FORMATS
16
+ from ..exceptions import KeyNotFoundError as KeyNotFoundError
17
+ from ..exceptions import KeyNotCompatibleException as KeyNotCompatibleException
18
+ from ..exceptions import IncompatibleObjectTypeException as IncompatibleObjectTypeException
19
+ from .model_storage import ModelDatastore as ModelDatastore
20
+ from .exceptions import LoadingException as LoadingException
21
+ from ..datastore.utils import safe_serialize as safe_serialize
22
+ from ..utils.general import get_path_size as get_path_size
23
+ from ..utils.general import unit_convert as unit_convert
24
+ from ..utils.general import warning_message as warning_message
25
+ from ..utils.identity_utils import safe_hash as safe_hash
26
+ from ..utils.serialization_handler.tar import TarHandler as TarHandler
27
+ from ..datastructures import ModelArtifact as ModelArtifact
28
+ from ..datastructures import Factory as Factory
29
+ from ..datastructures import MetaflowDataArtifactReference as MetaflowDataArtifactReference
30
+
31
+ MAX_HASH_LEN: int
32
+
33
+ SERIALIZATION_HANDLERS: dict
34
+
35
+ OBJECT_MAX_SIZE_ALLOWED_FOR_ARTIFACT: int
36
+
37
+ def create_write_store(pathspec, attempt, storage_backend) -> metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.model_storage.ModelDatastore:
38
+ ...
39
+
40
+ def create_read_store(storage_backend, model_key = None, pathspec = None, attempt = None) -> metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.modeling_utils.model_storage.ModelDatastore:
41
+ ...
42
+
43
+ class LoadedModels(object, metaclass=type):
44
+ """
45
+ A class that loads models from the datastore and stores them in a temporary directory.
46
+ This class helps manage all the models loaded via `@model(load=...)` decorator and
47
+ `current.model.load` method.
48
+
49
+ It is exposed via the `current.model.loaded` property. It is a dictionary like object
50
+ that stores the loaded models in a temporary directory. The keys of the dictionary are the
51
+ artifact names and the values are the paths to the temporary directories where the models are stored.
52
+
53
+ Usage:
54
+ ------
55
+ ```python
56
+ @model(load=["model_key", "chckpt_key"])
57
+ @step
58
+ def mid_step(self):
59
+ import os
60
+ os.listdir(current.model.loaded["model_key"])
61
+ os.listdir(current.model.loaded["chckpt_key"])
62
+ ```
63
+ """
64
+ def __init__(self, storage_backend, flow, artifact_references: typing.Union[typing.List[str], typing.List[typing.Tuple[str, typing.Optional[str]]], str], best_effort = False, temp_dir_root = None, mode = 'eager', logger = None):
65
+ ...
66
+ @property
67
+ def info(self):
68
+ ...
69
+ def __getitem__(self, key):
70
+ ...
71
+ def __contains__(self, key):
72
+ ...
73
+ def __iter__(self):
74
+ ...
75
+ def __len__(self):
76
+ ...
77
+ def cleanup(self, artifact_name):
78
+ ...
79
+ ...
80
+
81
+ class ModelSerializer(object, metaclass=type):
82
+ def __init__(self, pathspec, attempt, storage_backend):
83
+ ...
84
+ @property
85
+ def loaded(self) -> LoadedModels:
86
+ ...
87
+ def save(self, path, label = None, metadata = None, storage_format = 'tar'):
88
+ ...
89
+ def load(self, reference: typing.Union[str, metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures.MetaflowDataArtifactReference, dict], path: typing.Optional[str] = None):
90
+ """
91
+ Load a model/checkpoint from the datastore to a temporary directory or a specified path.
92
+
93
+ Returns:
94
+ --------
95
+ str : The path to the temporary directory where the model is loaded.
96
+ """
97
+ ...
98
+ ...
99
+
@@ -0,0 +1,25 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.713234 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import metaflow
10
+ import typing
11
+ if typing.TYPE_CHECKING:
12
+ import metaflow.exception
13
+
14
+ from ......exception import MetaflowException as MetaflowException
15
+
16
+ class LoadingException(metaflow.exception.MetaflowException, metaclass=type):
17
+ def __init__(self, message):
18
+ ...
19
+ ...
20
+
21
+ class ModelException(metaflow.exception.MetaflowException, metaclass=type):
22
+ def __init__(self, message):
23
+ ...
24
+ ...
25
+
@@ -0,0 +1,80 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.713012 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import metaflow
10
+ import typing
11
+ if typing.TYPE_CHECKING:
12
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
13
+ import metaflow.datastore.datastore_storage
14
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core
15
+
16
+ from ..datastore.core import ObjectStorage as ObjectStorage
17
+ from ..datastore.core import DatastoreInterface as DatastoreInterface
18
+ from ..datastore.core import STORAGE_FORMATS as STORAGE_FORMATS
19
+ from .exceptions import ModelException as ModelException
20
+ from ..exceptions import KeyNotFoundError as KeyNotFoundError
21
+ from ..datastructures import ModelArtifact as ModelArtifact
22
+ from ..exceptions import KeyNotCompatibleWithObjectException as KeyNotCompatibleWithObjectException
23
+
24
+ MODELS_PEFFIX: str
25
+
26
+ ARTIFACT_STORE_NAME: str
27
+
28
+ METADATA_STORE_NAME: str
29
+
30
+ ARTIFACT_METADATA_STORE_NAME: str
31
+
32
+ class ModelPathComponents(tuple, metaclass=type):
33
+ """
34
+ ModelPathComponents(model_uuid, root_prefix)
35
+ """
36
+ @staticmethod
37
+ def __new__(_cls, model_uuid, root_prefix):
38
+ """
39
+ Create new instance of ModelPathComponents(model_uuid, root_prefix)
40
+ """
41
+ ...
42
+ def __repr__(self):
43
+ """
44
+ Return a nicely formatted representation string
45
+ """
46
+ ...
47
+ def __getnewargs__(self):
48
+ """
49
+ Return self as a plain tuple. Used by copy and pickle.
50
+ """
51
+ ...
52
+ ...
53
+
54
+ def decompose_model_artifact_key(key):
55
+ ...
56
+
57
+ class ModelDatastore(metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core.DatastoreInterface, metaclass=type):
58
+ def save(self, artifact: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures.ModelArtifact, file_path, storage_format = 'tar'):
59
+ ...
60
+ def load_metadata(self, model_id):
61
+ ...
62
+ def save_metadata(self, attempt, model_id, metadata):
63
+ ...
64
+ def load(self, model_id, path):
65
+ ...
66
+ def list(self, *args, **kwargs):
67
+ ...
68
+ @classmethod
69
+ def init_read_store(cls, storage_backend: metaflow.datastore.datastore_storage.DataStoreStorage, pathspec: typing.Optional[str] = None, attempt: typing.Optional[str] = None, model_key = None, *args, **kwargs):
70
+ ...
71
+ @classmethod
72
+ def decompose_key(cls, key):
73
+ ...
74
+ @classmethod
75
+ def init_write_store(cls, storage_backend: metaflow.datastore.datastore_storage.DataStoreStorage, pathspec: str, attempt, *args, **kwargs):
76
+ ...
77
+ def __init__(self, artifact_store: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core.ObjectStorage, metadata_store: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core.ObjectStorage, artifact_metadatastore: metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.datastore.core.ObjectStorage):
78
+ ...
79
+ ...
80
+
@@ -1,6 +1,6 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.012845 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.709772 #
5
5
  ######################################################################################################
6
6
 
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.012898 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.709833 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.014898 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.713804 #
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.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.029811 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.714285 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -0,0 +1,6 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.714621 #
5
+ ######################################################################################################
6
+
@@ -0,0 +1,20 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.752477 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import typing
12
+
13
+
14
+ class SerializationHandler(object, metaclass=type):
15
+ def serialze(self, *args, **kwargs) -> typing.Union[str, bytes]:
16
+ ...
17
+ def deserialize(self, *args, **kwargs) -> typing.Any:
18
+ ...
19
+ ...
20
+
@@ -0,0 +1,25 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.714675 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import metaflow
10
+ import typing
11
+ if typing.TYPE_CHECKING:
12
+ import metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.utils.serialization_handler.base
13
+
14
+ from ..tar_utils import create_tarball_in_memory as create_tarball_in_memory
15
+ from ..tar_utils import create_tarball_on_disk as create_tarball_on_disk
16
+ from ..tar_utils import extract_tarball as extract_tarball
17
+ from .base import SerializationHandler as SerializationHandler
18
+
19
+ class TarHandler(metaflow.mf_extensions.obcheckpoint.plugins.machine_learning_utilities.utils.serialization_handler.base.SerializationHandler, metaclass=type):
20
+ def serialize(self, path_to_compress, path_to_save = None, in_memory = False, strict = False) -> typing.Union[str, bytes]:
21
+ ...
22
+ def deserialize(self, path_or_bytes, target_directory) -> str:
23
+ ...
24
+ ...
25
+
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39.1+obcheckpoint(0.1.4);ob(v1) #
4
- # Generated on 2024-12-17T21:56:51.014507 #
3
+ # MF version: 2.13.0.1+obcheckpoint(0.1.6);ob(v1) #
4
+ # Generated on 2024-12-20T17:11:09.751388 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations