ラージ・モデル・アーティファクトのインポート

次のステップを使用して、データ・サイエンス・サービス・バケットからストレージ・バケットにモデル・アーティファクトをインポートします。

ノート

インポートは、Java SDK、CLIおよびADS Python SDKのAPIを使用してのみ実行できます。コンソールからインポートを実行することはできません。
インポート・エンドポイントをコールし、ストレージ・バケットの詳細を指定します。

例:

#sample code
import ads
from ads.model import DataScienceModel

ads.set_auth("resource_principal")

dsc_model = DataScienceModel.from_id("oci://...") # The model OCID.
dsc_model.download_artifact(
    target_dir = dsc_model.id,
    force_overwrite=True,                            # Overwrite target directory if exists.
    bucket_uri = "oci://bucket@namespace/prefix/",   # The OCI Object Storage URI where model artifacts will be copied to.   
    overwrite_existing_artifact=True,                # Overwrite target bucket artifact if exists.
    remove_existing_artifact=True                    # Wether artifacts uploaded to object storage bucket need to be removed or not. )

インポート処理の作業リクエストが作成されます。「作業リクエスト」タブから、作業リクエストのステータスをチェックして、モデル・アーティファクトをストレージ・バケットにアップロードできます。

サンプル・インポート・アーティファクト・リクエスト

サービス・バケットからストレージ・バケットにモデル・アーティファクトをインポートするサンプル・アーティファクト・リクエスト:

curl --location --request POST 'http://localhost:24000/20190101/models/ocid1.datasciencemodel.oc1.iad.aaaaaaaaqwtoxslqnji4um4on7ktdpbmjp2fugqaxt2wvxrigjr2dpmxegma/actions/importArtifact' \
--header 'Content-Type: application/json' \
--data-raw '{
"artifactImportDetails" :
{
"artifactSourceType": "ORACLE_OBJECT_STORAGE",
"destinationBucket": "ds-scratch",
"destinationObjectName": "ADS.py",
"namespace": "ociodscdev",
"destinationRegion": "us-ashburn-1"
}
}'