oracle / accelerated-data-science

ADS is the Oracle Data Science Cloud Service's python SDK supporting, model ops (train/eval/deploy), along with running workloads on Jobs and Pipeline resources.
https://accelerated-data-science.readthedocs.io/
Universal Permissive License v1.0
87 stars 43 forks source link

Feature/multi model artifact handler #869

Closed YashPandit4u closed 3 months ago

YashPandit4u commented 4 months ago

Adding a new class to easily handle multi-model artifact creation in ADS.

oracle-contributor-agreement[bot] commented 4 months ago

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

YashPandit4u commented 4 months ago

Hi @VipulMascarenhas ,

I have now extended from the class already present in ads and the usage of the utility looks like this now:

import sys import ads.common from ads.model.model_collection import DataScienceModelCollection import ads import json

ads.set_auth(auth="security_token")

mdes = DataScienceModelCollection() \ .with_ref_model_id(model_ocid="ocid1.datasciencemodel.oc1.iad.amaaaaaav66vvnialtuoq5y4ltdz26bxhlow4uh5w544ullowe3jl4vwuayq") \ .with_display_name("New Design 8") \ .with_compartment_id("ocid1.tenancy.oc1..aaaaaaaahzy3x4boh7ipxyft2rowu2xeglvanlfewudbnueugsieyuojkldq") \ .with_project_id("ocid1.datascienceproject.oc1.iad.amaaaaaav66vvniaqsyu2nufljutkn4rzth2nz4q3zqslirct7eayl5ojpma")

mdes.add(namespace="ociodscdev", bucket="unzip-multi-model", prefix="model-linear-1") mdes.remove(namespace="ociodscdev", bucket="unzip-multi-model", prefix="model-linear-1")

mdes.create()

sys.exit(0)

Please take a look when free and give your comments.

Thanks and Regards Yash Pandit

VipulMascarenhas commented 4 months ago

@YashPandit4u thanks for making all the changes here, looks good overall. One concern I have is around the path inputs, it would be good to have the oci path like I mentioned in the comments above as user can construct the path easily with the params (bucket, namespace and prefix). Also, could you please add a couple unit tests in test_datascience_model.py for this change?

cc: @mrDzurb

YashPandit4u commented 3 months ago

Hi @VipulMascarenhas , thanks for telling the improvement items.

YashPandit4u commented 3 months ago

Hi @VipulMascarenhas , Based on the management decision, I have reverted the method signatures to the ones suggested by the customer.

YashPandit4u commented 3 months ago

Hi @VipulMascarenhas ,

I have now added options for both uri and (namespace, bucket, prefix) in add_artifact, remove_artifact.