本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 endpoints 命令管理推論端點
您可以使用 Neptune ML endpoints 命令來建立推論端點、檢查其狀態、將其刪除,或列出現有的推論端點。
使用 Neptune ML endpoints 命令建立推論端點
如下 Neptune ML endpoints 命令可從訓練工作所建立的模型建立推論端點:
curl \ -X POST https://(your Neptune endpoint)/ml/endpoints -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
如下 Neptune ML endpoints 命令可從訓練工作所建立的模型更新現有的推論端點:
curl \ -X POST https://(your Neptune endpoint)/ml/endpoints -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
如下 Neptune ML endpoints 命令可從模型轉換工作所建立的模型建立推論端點:
curl \ -X POST https://(your Neptune endpoint)/ml/endpoints -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-training job-id of a completed job)" }'
如下 Neptune ML endpoints 命令可從模型轉換工作所建立的模型更新現有的推論端點:
curl \ -X POST https://(your Neptune endpoint)/ml/endpoints -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "update" : "true", "mlModelTransformJobId": "(the model-training job-id of a completed job)" }'
用於建立 endpoints 推論端點的參數
-
id– (選用) 新推論端點的唯一識別符。類型:字串 預設值:自動產生的時間戳記名稱。
-
mlModelTrainingJobId– 已完成模型訓練工作的工作 ID,該工作已建立推論端點將指向的模型。類型:字串
注意:您必須提供
mlModelTrainingJobId或mlModelTransformJobId。 -
mlModelTransformJobId– 已完成模型轉換工作的工作 ID。類型:字串
注意:您必須提供
mlModelTrainingJobId或mlModelTransformJobId。 -
update– (選用) 如果存在,此參數指示這是更新請求。類型:布林值。預設:
false注意:您必須提供
mlModelTrainingJobId或mlModelTransformJobId。 -
neptuneIamRoleArn– (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會擲回錯誤。
-
modelName– (選用) 用於訓練的模型類型。根據預設,ML 模型會是自動以資料處理中使用的modelType為基礎,但您可以在這裡指定不同的模型類型。類型:字串 預設值:
rgcn用於異質圖和kge用於知識圖譜。有效值:若為異質圖:rgcn。若為知識圖譜:kge、transe、distmult或rotate。 -
instanceType– (選用) 用於線上服務的 ML 執行個體類型。類型:字串 預設︰
ml.m5.xlarge。注意:為推論端點選擇 ML 執行個體,取決於任務類型、圖形大小以及您的預算。請參閱 為推論端點選取執行個體。
-
instanceCount– (選用) 要部署到端點進行預測的 Amazon EC2 執行個體數量下限。類型:整數。預設︰
1。 -
volumeEncryptionKMSKey– (選用) SageMaker AI 用來加密連接至執行端點之 ML 運算執行個體之儲存磁碟區上的資料 AWS Key Management Service ()AWS KMS金鑰。類型:字串 預設值:none。
使用 Neptune ML endpoints 命令取得推論端點的狀態
執行個體端點狀態的範例 Neptune ML endpoints 命令如下所示:
curl -s \ "https://(your Neptune endpoint)/ml/endpoints/(the inference endpoint ID)" \ | python -m json.tool
endpoints 執行個體-端點狀態的參數
-
id– (必要) 推論端點的唯一識別符。類型:字串
-
neptuneIamRoleArn– (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會擲回錯誤。
使用 Neptune ML endpoints 命令刪除執行個體端點
用於刪除執行個體端點的範例 Neptune ML endpoints 命令如下所示:
curl -s \ -X DELETE "https://(your Neptune endpoint)/ml/endpoints/(the inference endpoint ID)"
或如下所示:
curl -s \ -X DELETE "https://(your Neptune endpoint)/ml/endpoints/(the inference endpoint ID)?clean=true"
endpoints 刪除推論端點的參數
-
id– (必要) 推論端點的唯一識別符。類型:字串
-
neptuneIamRoleArn– (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會擲回錯誤。
-
clean– (選用) 指示也應刪除與此端點相關的所有成品。類型:布林值。預設︰
FALSE。
使用 Neptune ML endpoints 命令列出推論端點
用於列出推論端點的 Neptune ML endpoints 命令如下所示:
curl -s "https://(your Neptune endpoint)/ml/endpoints" \ | python -m json.tool
或如下所示:
curl -s "https://(your Neptune endpoint)/ml/endpoints?maxItems=3" \ | python -m json.tool
dataprocessing 列出推論端點的參數
-
maxItems– (選用) 要傳回的項目數上限。類型:整數。預設︰
10。允許的最大值:1024。 -
neptuneIamRoleArn– (選用) IAM 角色的 ARN,提供對 SageMaker AI 和 Amazon S3 資源的 Neptune 存取權。類型:字串 注意:這必須列示在您的資料庫叢集參數群組中,否則會擲回錯誤。