Spaces:
Runtime error
Runtime error
VenkateshRoshan
commited on
Commit
·
dd44216
1
Parent(s):
b7b0ece
deployment file update
Browse files- src/deploy_sagemaker.py +4 -1
src/deploy_sagemaker.py
CHANGED
|
@@ -4,6 +4,7 @@ import sagemaker
|
|
| 4 |
from sagemaker.model import Model
|
| 5 |
import argparse
|
| 6 |
import os
|
|
|
|
| 7 |
|
| 8 |
# Set up logging
|
| 9 |
logging.basicConfig(level=logging.INFO)
|
|
@@ -25,12 +26,14 @@ def deploy_app(acc_id, region_name, role_arn, ecr_repo_name, endpoint_name="cust
|
|
| 25 |
|
| 26 |
# Define the image URI in ECR
|
| 27 |
ecr_image = f"{acc_id}.dkr.ecr.{region_name}.amazonaws.com/{ecr_repo_name}:latest"
|
|
|
|
| 28 |
|
| 29 |
# Define model
|
| 30 |
model = Model(
|
| 31 |
image_uri=ecr_image,
|
| 32 |
role=role_arn,
|
| 33 |
-
sagemaker_session=sagemaker_session
|
|
|
|
| 34 |
)
|
| 35 |
|
| 36 |
# Deploy model as a SageMaker endpoint
|
|
|
|
| 4 |
from sagemaker.model import Model
|
| 5 |
import argparse
|
| 6 |
import os
|
| 7 |
+
from datetime import datetime
|
| 8 |
|
| 9 |
# Set up logging
|
| 10 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 26 |
|
| 27 |
# Define the image URI in ECR
|
| 28 |
ecr_image = f"{acc_id}.dkr.ecr.{region_name}.amazonaws.com/{ecr_repo_name}:latest"
|
| 29 |
+
model_name = f"customer-support-chatbot-{datetime.now().strftime('%Y%m%d-%H%M%S')}"
|
| 30 |
|
| 31 |
# Define model
|
| 32 |
model = Model(
|
| 33 |
image_uri=ecr_image,
|
| 34 |
role=role_arn,
|
| 35 |
+
sagemaker_session=sagemaker_session,
|
| 36 |
+
model_name=model_name # Use the compliant model name
|
| 37 |
)
|
| 38 |
|
| 39 |
# Deploy model as a SageMaker endpoint
|