azureml-acft-multimodal-components 0.0.70__py3-none-any.whl → 0.0.72__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- ver = "0.0.70"
2
- selfver = "0.0.70"
1
+ ver = "0.0.72"
2
+ selfver = "0.0.72"
@@ -11,15 +11,13 @@ from typing import Dict, Any, Union
11
11
  import shutil
12
12
  import yaml
13
13
  import json
14
- from azure.identity import DefaultAzureCredential
15
- from azure.ai.ml import MLClient
16
14
 
17
15
  from azureml.acft.common_components import get_logger_app
18
16
  from azureml.acft.accelerator.utils.error_handling.exceptions import LLMException
19
- from azureml.acft.accelerator.utils.error_handling.error_definitions import LLMInternalError
17
+ from azureml.acft.accelerator.utils.error_handling.error_definitions import LLMInternalError, MissingData
20
18
  from azureml._common._error_definition.azureml_error import AzureMLError # type: ignore
21
19
  from azureml.acft.multimodal.components.constants.constants import SaveFileConstants, MLFlowHFFlavourConstants, \
22
- MLFlowPyfuncLiterals, ModelTypes
20
+ MLFlowPyfuncLiterals
23
21
 
24
22
  logger = get_logger_app(__name__)
25
23
 
@@ -221,50 +219,6 @@ def convert_pyfunc_mlflow_to_pytorch_model(mlflow_model_path: str, download_dir:
221
219
  )
222
220
 
223
221
 
224
- def download_model_from_registry(model_name: str, download_dir: str):
225
- """
226
- downloads mlflow models from azureml-preview registry
227
- """
228
- # in azure-ai-ml-1.0.0 DefaultAzureCredential handles ManagedIdentityCredential internally
229
- client_id = os.environ.get("DEFAULT_IDENTITY_CLIENT_ID", None)
230
- if client_id:
231
- logger.info("Using DEFAULT_IDENTITY_CLIENT_ID")
232
- credential = DefaultAzureCredential(managed_identity_client_id=client_id)
233
- else:
234
- credential = DefaultAzureCredential()
235
- registry_mlclient = MLClient(credential=credential, registry_name=MODEL_REGISTRY_NAME)
236
- registry_models_list = registry_mlclient.models.list(name=model_name)
237
- registry_models_versions = [int(model.version) for model in registry_models_list]
238
-
239
- # download the model from registry - mlflow model
240
- model_tmp_download_path = os.path.join(download_dir, "azuremlft_download")
241
- if len(registry_models_versions) > 0:
242
- model_version = str(max(registry_models_versions))
243
- registry_mlclient.models.download(
244
- name=model_name,
245
- version=model_version,
246
- download_path=model_tmp_download_path,
247
- )
248
- logger.info(f"Model {model_name}/{model_version} is downloaded")
249
- mlflow_model_dir = os.path.join(
250
- model_tmp_download_path, model_name,
251
- MLFlowHFFlavourConstants.MODEL_ROOT_DIRECTORY
252
- )
253
- model_save_path = os.path.join(download_dir, model_name)
254
- # convert mlflow model to pytorch model and save it to model_save_path
255
- if model_name == ModelTypes.MMEFT:
256
- convert_pyfunc_mlflow_to_pytorch_model(mlflow_model_dir, model_save_path)
257
- else:
258
- convert_hf_mlflow_to_pytorch_model(mlflow_model_dir, model_save_path)
259
- else:
260
- raise LLMException._with_error(
261
- AzureMLError.create(
262
- LLMInternalError,
263
- error="Model not found in registry"
264
- )
265
- )
266
-
267
-
268
222
  def model_selector(model_selector_args: Dict[str, Any]):
269
223
  """
270
224
  Downloads model from azureml-preview registry if present
@@ -315,16 +269,8 @@ def model_selector(model_selector_args: Dict[str, Any]):
315
269
  else:
316
270
  convert_hf_mlflow_to_pytorch_model(mlflow_model_path, download_dir)
317
271
  else:
318
- try:
319
- logger.info(f'Downloading the model from registry to {model_selector_args["output_dir"]}')
320
- download_model_from_registry(model_selector_args["model_name"], model_selector_args["output_dir"])
321
- except Exception as e:
322
- # TODO Check why shutil rmtree is called
323
- # shutil.rmtree(model_selector_args["output_dir"], ignore_errors=True)
324
- logger.info(
325
- f'Unable to download model, will fetch {model_selector_args["model_name"]} model while fine-tuning',
326
- exc_info=True
327
- )
272
+ logger.error("missing mlflow and pytorch model path")
273
+ raise LLMException._with_error(AzureMLError.create(MissingData, data_argument_name="model_path"))
328
274
 
329
275
  # Saving model selector args
330
276
  model_selector_args_save_path = os.path.join(model_selector_args["output_dir"],
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: azureml-acft-multimodal-components
3
- Version: 0.0.70
3
+ Version: 0.0.72
4
4
  Summary: Contains the acft multimodal-contrib package used in script to build azureml components.
5
5
  Home-page: https://msdata.visualstudio.com/Vienna/_git/sdk-cli-v2?version=GBtraining_finetune
6
6
  Author: Microsoft Corp
@@ -41,6 +41,7 @@ Dynamic: description
41
41
  Dynamic: description-content-type
42
42
  Dynamic: home-page
43
43
  Dynamic: license
44
+ Dynamic: license-file
44
45
  Dynamic: provides-extra
45
46
  Dynamic: requires-dist
46
47
  Dynamic: requires-python
@@ -3,7 +3,7 @@ azureml/acft/__init__.py,sha256=9yEu-iBWQHMmb7eapxBKtSs5hHWMDIZeGhXEntYSp4w,267
3
3
  azureml/acft/multimodal/__init__.py,sha256=9yEu-iBWQHMmb7eapxBKtSs5hHWMDIZeGhXEntYSp4w,267
4
4
  azureml/acft/multimodal/components/NOTICE.txt,sha256=Wi77VU9zlsSpIoTfQyhQ73Nwze4miS9YDG4rcI6izo4,530804
5
5
  azureml/acft/multimodal/components/__init__.py,sha256=qC5hRHbTbRwhm4xSfuFpDl0ungDu3rxgX7bfPsaTQVA,792
6
- azureml/acft/multimodal/components/_version.py,sha256=u8TK3F765DOTjiO6122J9B_zP36XQ1O3Vo5pwSa9104,36
6
+ azureml/acft/multimodal/components/_version.py,sha256=hSHlV8vLL9jPcHbarNf9j12RY_GUE-BNDwSwWxwsHEA,36
7
7
  azureml/acft/multimodal/components/base_runner.py,sha256=DpEqtXoO1iwqd5EJtjXauZ_D3C2LLLoqT2wYw-84YDg,1235
8
8
  azureml/acft/multimodal/components/task_factory.py,sha256=Ar4emx5xmw72NZKkDzw6tdixw9d6PiGTSa1CsleyqKY,980
9
9
  azureml/acft/multimodal/components/artifacts/__init__.py,sha256=ouf2rAWSHFJAg_qtQ9B9JwI7xakZ69hDiMGqpDuzL-c,298
@@ -49,10 +49,10 @@ azureml/acft/multimodal/components/tasks/multimodal_classification/preprocess/au
49
49
  azureml/acft/multimodal/components/tasks/multimodal_classification/preprocess/preprocess_for_finetune.py,sha256=1HP-HegyMJywUvEfuXxMWXdTBxkNJM3Za18ZTLtDfYs,11999
50
50
  azureml/acft/multimodal/components/utils/__init__.py,sha256=9yEu-iBWQHMmb7eapxBKtSs5hHWMDIZeGhXEntYSp4w,267
51
51
  azureml/acft/multimodal/components/utils/common_utils.py,sha256=CDqbSGlQHedatUXOnjPV8cAcW1-BKap48R4g-D-4Va8,2105
52
- azureml/acft/multimodal/components/utils/model_selector_utils.py,sha256=gLQNgWVONG4mhqls1vfFl301YITuHJUTJB6EJPoowW4,12833
52
+ azureml/acft/multimodal/components/utils/model_selector_utils.py,sha256=GuckKzNcOmjc2hFqVEGZiEElhJGzqNR2borBE7k6xmE,10318
53
53
  azureml/acft/multimodal/components/utils/trainer_callbacks.py,sha256=3ElNRjxp8Ipt2xC-NQUEy676FLd26K0URB7aPRK2p2c,5795
54
- azureml_acft_multimodal_components-0.0.70.dist-info/LICENSE.txt,sha256=GBoIyZ-6vJ4xjRc8U3wTw4EfkuaEdVTm_gbr1Nm8uDI,859
55
- azureml_acft_multimodal_components-0.0.70.dist-info/METADATA,sha256=G7wIS2iaUE4Q_y-OOhRaAtkze-VFS6kQh0q3O9DyFRI,2051
56
- azureml_acft_multimodal_components-0.0.70.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
57
- azureml_acft_multimodal_components-0.0.70.dist-info/top_level.txt,sha256=ZOeEa0TAXo6i5wOjwBoqfIGEuxOcKuscGgNSpizqREY,8
58
- azureml_acft_multimodal_components-0.0.70.dist-info/RECORD,,
54
+ azureml_acft_multimodal_components-0.0.72.dist-info/licenses/LICENSE.txt,sha256=GBoIyZ-6vJ4xjRc8U3wTw4EfkuaEdVTm_gbr1Nm8uDI,859
55
+ azureml_acft_multimodal_components-0.0.72.dist-info/METADATA,sha256=tms92XU3HDsekgUDEtS7FcuwjdjA96CHb9IQCZ0zp-w,2074
56
+ azureml_acft_multimodal_components-0.0.72.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
57
+ azureml_acft_multimodal_components-0.0.72.dist-info/top_level.txt,sha256=ZOeEa0TAXo6i5wOjwBoqfIGEuxOcKuscGgNSpizqREY,8
58
+ azureml_acft_multimodal_components-0.0.72.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5