本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
刪除自訂模型部署
使用模型進行隨需推論後,您可以刪除部署。刪除部署後,您無法將其用於隨需推論,但刪除部署不會刪除基礎自訂模型。
您可以使用 Amazon Bedrock 主控台 AWS Command Line Interface或 AWS SDKs刪除自訂模型部署。
重要
刪除自訂模型部署是無法復原的。在繼續刪除之前,請確定您不再需要部署。如果您需要再次使用自訂模型進行隨需推論,則必須建立新的部署。
刪除自訂模型部署 (主控台)
刪除自訂模型部署
-
在導覽窗格的推論下,選擇隨需自訂模型。
-
選擇您要刪除的自訂模型部署。
-
選擇 刪除。
-
在確認對話方塊中,輸入部署名稱以確認刪除。
-
選擇刪除以確認刪除。
刪除自訂模型部署 (AWS Command Line Interface)
若要使用 刪除自訂模型部署 AWS Command Line Interface,請使用 delete-custom-model-deployment
命令搭配您的部署識別符。此命令使用 DeleteCustomModelDeployment API 操作。
aws bedrock delete-custom-model-deployment \ --custom-model-deployment-identifier "
deployment-arn-or-name
" \ --regionregion
刪除自訂模型部署AWS SDKs)
若要以程式設計方式刪除自訂模型部署,請使用 DeleteCustomModelDeployment API 操作搭配部署的 Amazon Resource Name (ARN) 或名稱。下列程式碼說明如何使用適用於 Python (Boto3) 的 SDK 來刪除自訂模型部署。
def delete_custom_model_deployment(bedrock_client): """Delete a custom model deployment Args: bedrock_client: A boto3 Amazon Bedrock client for making API calls Returns: dict: The response from the delete operation Raises: Exception: If there is an error deleting the deployment """ try: response = bedrock_client.delete_custom_model_deployment( customModelDeploymentIdentifier="
Deployment identifier
" ) print("Deleting deployment...") return response except Exception as e: print(f"Error deleting deployment: {str(e)}") raise