This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "length": -0.158164, | |
| "diameter": -0.280982, | |
| "height": -0.227545, | |
| "whole_weight": -0.352298, | |
| "shucked_weight": -0.596421, | |
| "viscera_weight": -0.019102, | |
| "shell_weight": -0.135293, | |
| "sex_M": 0.0, | |
| "sex_F": 0.0, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import boto3 | |
| import joblib | |
| import pandas as pd | |
| # download model file from S3 into /tmp folder | |
| s3 = boto3.client('s3') | |
| bucket = os.environ['BUCKET'] | |
| key = os.environ['KEY'] | |
| s3.download_file(bucket, key, '/tmp/model.pkl') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM public.ecr.aws/lambda/python:3.8 | |
| # Install dependencies | |
| COPY requirements.txt /tmp/ | |
| RUN pip3 install -r /tmp/requirements.txt --no-cache | |
| # Copy inference code | |
| COPY predict.py ${LAMBDA_TASK_ROOT}/ | |
| CMD [ "predict.handler" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import core | |
| from stacks.api_stack import ApiStack | |
| from stacks.lambda_stack import LambdaStack | |
| from stacks.state_machine_stack import StateMachineStack | |
| class InferenceStack(core.Stack): | |
| def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | |
| super().__init__(scope, id, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "CRIM": 0.0063, | |
| "ZN": 18, | |
| "INDUS": 2.31, | |
| "CHAS": 0, | |
| "NOX": 0.538, | |
| "RM": 6.575, | |
| "AGE": 65.2, | |
| "DIS": 4.09, | |
| "RAD": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: Deploys a scheduled Lambda function to shutdown Studio kernels automatically | |
| Resources: | |
| #================================================================================ | |
| # LAMBDA | |
| #================================================================================ | |
| StudioShutdownFunction: | |
| Type: AWS::Lambda::Function | |
| Properties: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import boto3 | |
| import logging | |
| from botocore.config import Config | |
| logger = logging.getLogger() | |
| logger.setLevel(logging.INFO) | |
| config = Config(retries = {'max_attempts': 10,'mode': 'standard'}) | |
| sagemaker = boto3.client('sagemaker', config=config) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "crim": 0.0063, | |
| "zn": 18, | |
| "indus": 2.31, | |
| "chas": 0, | |
| "nox": 0.538, | |
| "rm": 6.575, | |
| "age": 65.2, | |
| "dis": 4.09, | |
| "rad": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import ( | |
| aws_lambda, | |
| aws_iam, | |
| aws_apigatewayv2, | |
| core | |
| ) | |
| class InferenceStack(core.Stack): | |
| def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: |