Skip to content

Commit

Permalink
add main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HichamBenbriqa committed Dec 24, 2023
1 parent ef8e681 commit e876de4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
MODEL_ID = os.getenv("MODEL_ID")
AWS_SAGEMAKER_ROLE = os.getenv("AWS_SAGEMAKER_ROLE")
AWS_REGION = os.getenv("AWS_REGION")
S3_BUCKET = os.getenv("S3_BUCKET")


class Deployer:
Expand Down Expand Up @@ -62,12 +63,13 @@ def upload_model_artifact_to_s3(self):
"""_summary_."""
s3 = self.boto_session.resource("s3")

default_bucket = sagemaker.Session().default_bucket()
# default_bucket = sagemaker.Session().default_bucket()

model_artifacts = f"s3://{default_bucket}/{self.model_artifacts_tar}"
# model_artifacts = f"s3://{default_bucket}/{self.model_artifacts_tar}"
model_artifacts = f"s3://{S3_BUCKET}/{self.model_artifacts_tar}"

response = s3.meta.client.upload_file(
self.model_artifacts_tar, default_bucket, self.model_artifacts_tar
self.model_artifacts_tar, S3_BUCKET, self.model_artifacts_tar
)
print(response)
return model_artifacts
Expand Down

1 comment on commit e876de4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Training Job Report
Training Job parameters: {'n_estimators': 30, 'max_depth': 10}
RMSE:
8.70103709517472

CML watermark

Please sign in to comment.