使用管理推理端点endpoints命令 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用管理推理端点endpoints命令

你使用 Neptune MLendpoints命令来创建推理端点、检查其状态、删除它或列出现有的推理端点。

使用 Neptune ML 创建推理端点endpoints命令

Neptune MLendpoints用于根据训练作业创建的模型创建推理端点的命令如下所示:

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 MLendpoints用于从训练作业创建的模型更新现有推理端点的命令如下所示:

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 MLendpoints用于从模型转换作业创建的模型创建推理端点的命令如下所示:

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 MLendpoints用于从模型转换作业创建的模型更新现有推理端点的命令如下所示:

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,允许 Neptune 访问 SageMaker 和 Amazon S3 资源的 IAM 角色的 ARN。

    类型:字符串。注意:这必须列在数据库集群参数组中,否则会抛出错误。

  • modelName— (可选) 训练的模型类型。默认情况下,ML 模型自动基于modelType用于数据处理,但您可以在此指定不同的模型类型。

    类型:字符串。默认值rgcn对于异构图表和kge获取知识图表。 有效值:对于异构图表:rgcn. 对于知识图:kgetransedistmult,或者rotate.

  • instanceType— (可选) 用于在线服务的 ML 实例的类型。

    类型:字符串。默认值ml.m5.xlarge.

    注意:为推理终端节点选择 ML 实例取决于任务类型、图形大小和预算。请参阅为推理终端节点选择实例

  • instanceCount— (可选) 要部署到终端节点进行预测的 Amazon EC2 实例的最小数量。

    类型:整数。默认值1.

  • volumeEncryptionKMSKey— (可选) 该Amazon Key Management Service(Amazon KMS) 密钥,SageMaker 用于加密附加到运行终端节点的 ML 计算实例的存储卷上的数据的 SageMaker 使用的密钥。

    类型:字符串。默认值.

使用 Neptune ML 获取推理端点的状态endpoints命令

样本 Neptune MLendpoints实例终端节点状态的命令如下所示:

curl -s \ "https://(your Neptune endpoint)/ml/endpoints/(the inference endpoint ID)" \ | python -m json.tool
的参数endpoints实例终端节点状态
  • id— (必需) 推理终端节点的唯一标识符。

    类型:字符串。

  • neptuneIamRoleArn— (可选) IAM 角色的 ARN,允许 Neptune 访问 SageMaker 和 Amazon S3 资源的 IAM 角色的 ARN。

    类型:字符串。注意:这必须列在数据库集群参数组中,否则会抛出错误。

使用 Neptune ML 删除实例终端节点endpoints命令

样本 Neptune MLendpoints用于删除实例终端节点的命令如下所示:

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,允许 Neptune 访问 SageMaker 和 Amazon S3 资源的 IAM 角色的 ARN。

    类型:字符串。注意:这必须列在数据库集群参数组中,否则会抛出错误。

  • clean— (可选) 表示还应删除与此终端节点相关的所有工件。

    类型:布尔值。默认值FALSE.

使用 Neptune ML 列出推理端点endpoints命令

Neptune MLendpoints列出推理终端节点的命令如下所示:

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,允许 Neptune 访问 SageMaker 和 Amazon S3 资源的 IAM 角色的 ARN。

    类型:字符串。注意:这必须列在数据库集群参数组中,否则会抛出错误。