Skip to content

Commit

Permalink
Merge branch 'main' into atqy/refactor-predictive-maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
atqy authored May 3, 2022
2 parents 719aca7 + c2a51a8 commit 5be1a11
Show file tree
Hide file tree
Showing 23 changed files with 4,292 additions and 510 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@ LABEL com.amazonaws.sagemaker.capabilities.multi-models=true
# Set a docker label to enable container to use SAGEMAKER_BIND_TO_PORT environment variable if present
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true


# Upgrade installed packages
RUN apt-get update && apt-get upgrade -y && apt-get clean

# Python package management and basic dependencies
RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils

# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

# Set python 3 as the default python
RUN update-alternatives --set python /usr/bin/python3.7

# Install necessary dependencies for MMS and SageMaker Inference Toolkit
RUN apt-get update && \
apt-get -y install --no-install-recommends \
RUN apt-get -y install --no-install-recommends \
build-essential \
ca-certificates \
openjdk-8-jdk-headless \
python3-dev \
curl \
vim \
&& rm -rf /var/lib/apt/lists/* \
&& python --version \
&& curl -O https://bootstrap.pypa.io/get-pip.py \
&& python3 get-pip.py
&& python get-pip.py

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN update-alternatives --install /usr/local/bin/pip pip /usr/local/bin/pip3 1
Expand All @@ -40,4 +52,4 @@ COPY model_handler.py /home/model-server/model_handler.py
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]

# Define command to be passed to the entrypoint
CMD ["serve"]
CMD ["serve"]
4 changes: 3 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ On SageMaker Studio, you will need to open a terminal, go to your home folder, t

intro.rst

We recommend the following 20 notebooks as a broad introduction to the capabilities that SageMaker offers. To explore in even more depth, we provide additional notebooks covering even more use cases and frameworks.
We recommend the following notebooks as a broad introduction to the capabilities that SageMaker offers. To explore in even more depth, we provide additional notebooks covering even more use cases and frameworks.

.. toctree::
:maxdepth: 1
Expand All @@ -39,9 +39,11 @@ We recommend the following 20 notebooks as a broad introduction to the capabilit
:maxdepth: 1
:caption: Prepare data

sagemaker_processing/spark_distributed_data_processing/sagemaker-spark-processing_outputs
sagemaker_processing/basic_sagemaker_data_processing/basic_sagemaker_processing_outputs



.. toctree::
:maxdepth: 1
:caption: Train and tune models
Expand Down
3 changes: 2 additions & 1 deletion sagemaker-inference-recommender/inference-recommender.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"source": [
"if download_the_model:\n",
" tf.keras.backend.set_learning_phase(0)\n",
" model = tf.keras.applications.ResNet50()\n",
" input_tensor = tf.keras.Input(name=\"input_1\", shape=(224, 224, 3))\n",
" model = tf.keras.applications.resnet50.ResNet50(input_tensor=input_tensor)\n",
"\n",
" # Creating the directory strcture\n",
" model_version = \"1\"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If you specify a set of instance types below (i.e. non-empty list), then Inference Recommender will only support recommendations within the set of instances below. For this example, we provide a list of common CPU instance types used with XGBoost."
"If you specify a set of instance types below (i.e. non-empty list), then Inference Recommender will only support recommendations within the set of instances below. For this example, we provide a list of common CPU instance types used with XGBoost. Note that, if you want to try to compile your XGboost model with Amazon SageMaker Neo, then the `ModelInput` field is required for your model's input shape. Currently, it supports Images list here: [Inference Container Images](https://docs.aws.amazon.com/sagemaker/latest/dg/neo-deployment-hosting-services-container-images.html) or SageMaker XGboost containers. And you need to make sure the xgboost version is 1.0 to 1.3."
]
},
{
Expand Down Expand Up @@ -466,6 +466,9 @@
" \"Framework\": framework.upper(),\n",
" \"FrameworkVersion\": framework_version,\n",
" \"NearestModelName\": model_name,\n",
" \"ModelInput\": {\n",
" \"DataInputConfig\": '{\"data\": [1, 50]}' # this is required for compilation\n",
" },\n",
" }\n",
" ],\n",
" \"SupportedContentTypes\": input_mime_types, # required, must be non-null\n",
Expand Down
Loading

0 comments on commit 5be1a11

Please sign in to comment.