Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.37k stars 2.71k forks source link

No way to register associated data assets when registering Model with SDKv2 #36055

Open obiii opened 3 weeks ago

obiii commented 3 weeks ago

azure.ai.ml: 1.4.0: Linux 20xx: 3.10:

Describe the bug We wan to register a trained model in the shared ML registry.

To Reproduce

  1. Connect to workspace

    # get a handle to the workspace
    ml_client = MLClient.from_config(DefaultAzureCredential())
    print(ml_client.workspace_name, ml_client.resource_group_name, sep='\t\t')
  2. get registered data asset

    data_asset_name = "file-dataset"
    data_asset = ml_client.data.get(name=data_asset_name, version=1)
  3. train an arbitrary model

  4. register model with data asset

    from azure.ai.ml.entities import Model
    from azure.ai.ml.constants import AssetTypes
    file_model = Model(
    path="mlflow-model/model.pkl",
    type=AssetTypes.CUSTOM_MODEL,
    name="local-file-example",
    description="Model created from local file.",
    # in sdk v1 there was an attribute called datasets
    )
    ml_client.models.create_or_update(file_model)

Expected behavior There should be a way to attach data assets to the model just like with sdkv1 there was a datasets argument in run.register_model fucntion.

github-actions[bot] commented 3 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

edgBR commented 3 weeks ago

Ey, same problem here.

BR E

justkr commented 3 weeks ago

Hello, I have the same issueon this

seniut commented 3 weeks ago

Hello. I have met the same problem on my side

SzymonSowinski commented 3 weeks ago

Hi, I have the same issue

Abel-24pal commented 3 weeks ago

Hi, we have the same problem