

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

# 配置和创建端点
<a name="clarify-online-explainability-create-endpoint"></a>

创建适合您的模型的新端点配置，然后使用此配置创建端点。您可以使用在[预检查步骤](https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-precheck.html)中验证的模型容器来创建端点并启用 Clarify 在线 SageMaker 可解释性功能。

使用`sagemaker_client`对象通过 [CreateEndpointConfig](https://docs.aws.amazon.com//sagemaker/latest/APIReference/API_CreateEndpointConfig.html)API 创建终端节点。按照如下方式，在 `ExplainerConfig` 参数内设置成员 `ClarifyExplainerConfig`：

```
sagemaker_client.create_endpoint_config(
    EndpointConfigName='name-of-your-endpoint-config',
    ExplainerConfig={
        'ClarifyExplainerConfig': {
            'EnableExplanations': '`true`',
            'InferenceConfig': {
                ...
            },
            'ShapConfig': {
                ...
            }
        },
    },
    ProductionVariants=[{
        'VariantName': 'AllTraffic',
        'ModelName': 'name-of-your-model',
        'InitialInstanceCount': 1,
        'InstanceType': 'ml.m5.xlarge',
    }]
     ...
)
sagemaker_client.create_endpoint(
    EndpointName='name-of-your-endpoint',
    EndpointConfigName='name-of-your-endpoint-config'
)
```

第一次调用 `sagemaker_client` 对象时，会创建一个启用解释功能的新端点配置。第二个调用会使用端点配置来启动端点。

**注意**  
您还可以在[SageMaker 人工智能实时推理多模型端点后面的一个容器中托管多个模型](https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html)，并使用 Clarify 配置在线可解释性。 SageMaker 