使用 endpoints 命令管理推理端点 - Amazon Neptune

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

使用 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,该任务创建了推理端点将指向的模型。

    类型:字符串。

    注意:您必须提供 mlModelTrainingJobIdmlModelTransformJobId

  • mlModelTransformJobId – 已完成的模型转换任务的任务 ID。

    类型:字符串。

    注意:您必须提供 mlModelTrainingJobIdmlModelTransformJobId

  • update –(可选)如果存在,则此参数表示这是更新请求。

    类型:布尔值。默认值false

    注意:您必须提供 mlModelTrainingJobIdmlModelTransformJobId

  • neptuneIamRoleArn—(可选)向 Neptune 提供 AI 和 A SageMaker mazon S3 资源访问权限的 IAM 角色的 ARN。

    类型:字符串。注意:必须将其列在您的数据库集群参数组中,否则将引发错误。

  • modelName –(可选)训练的模型类型。默认情况下,机器学习模型是根据数据处理中使用的 modelType 自动生成的,但您可以在此处指定不同的模型类型。

    类型:字符串。默认rgcn 用于异构图形,kge 用于知识图谱。有效值:对于异构图形:rgcn。对于知识图谱:kgetransedistmultrotate

  • instanceType –(可选)用于在线服务的机器学习实例的类型。

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

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

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

    类型:整数。默认值1

  • volumeEncryptionKMSKey—(可选AWS KMS) SageMaker AI 用来加密连接到运行端点的 ML 计算实例的存储卷上的数据的 () 密钥。 AWS Key Management Service

    类型:字符串。默认值

使用 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—(可选)向 Neptune 提供 AI 和 A SageMaker mazon S3 资源访问权限的 IAM 角色的 ARN。

    类型:字符串。注意:必须将其列在您的数据库集群参数组中,否则将引发错误。

使用 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—(可选)向 Neptune 提供 AI 和 A SageMaker mazon S3 资源访问权限的 IAM 角色的 ARN。

    类型:字符串。注意:必须将其列在您的数据库集群参数组中,否则将引发错误。

  • 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—(可选)向 Neptune 提供 AI 和 A SageMaker mazon S3 资源访问权限的 IAM 角色的 ARN。

    类型:字符串。注意:必须将其列在您的数据库集群参数组中,否则将引发错误。